Go to file
David Howells 93a4315512 cifs: Fix missing set of remote_i_size
Occasionally, the generic/001 xfstest will fail indicating corruption in
one of the copy chains when run on cifs against a server that supports
FSCTL_DUPLICATE_EXTENTS_TO_FILE (eg. Samba with a share on btrfs).  The
problem is that the remote_i_size value isn't updated by cifs_setsize()
when called by smb2_duplicate_extents(), but i_size *is*.

This may cause cifs_remap_file_range() to then skip the bit after calling
->duplicate_extents() that sets sizes.

Fix this by calling netfs_resize_file() in smb2_duplicate_extents() before
calling cifs_setsize() to set i_size.

This means we don't then need to call netfs_resize_file() upon return from
->duplicate_extents(), but we also fix the test to compare against the pre-dup
inode size.

[Note that this goes back before the addition of remote_i_size with the
netfs_inode struct.  It should probably have been setting cifsi->server_eof
previously.]

Fixes: cfc63fc812 ("smb3: fix cached file size problems in duplicate extents (reflink)")
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Steve French <sfrench@samba.org>
cc: Paulo Alcantara <pc@manguebit.com>
cc: Shyam Prasad N <nspmangalore@gmail.com>
cc: Rohith Surabattula <rohiths.msft@gmail.com>
cc: Jeff Layton <jlayton@kernel.org>
cc: linux-cifs@vger.kernel.org
cc: netfs@lists.linux.dev
Signed-off-by: Steve French <stfrench@microsoft.com>
2024-05-24 16:05:56 -05:00
arch RDMA v6.10 merge window 2024-05-18 13:04:15 -07:00
block SCSI misc on 20240514 2024-05-14 18:25:53 -07:00
certs kbuild: use $(src) instead of $(srctree)/$(src) for source directory 2024-05-10 04:34:52 +09:00
crypto net-accept-more-20240515 2024-05-18 10:32:39 -07:00
Documentation NFSD 6.10 Release Notes 2024-05-18 14:04:20 -07:00
drivers RDMA v6.10 merge window 2024-05-18 13:04:15 -07:00
fs cifs: Fix missing set of remote_i_size 2024-05-24 16:05:56 -05:00
include smb3: reenable swapfiles over SMB3 mounts 2024-05-21 11:14:55 -05:00
init Kbuild updates for v6.10 2024-05-18 12:39:20 -07:00
io_uring net-accept-more-20240515 2024-05-18 10:32:39 -07:00
ipc sysctl changes for v6.10-rc1 2024-05-17 17:31:24 -07:00
kernel Kbuild updates for v6.10 2024-05-18 12:39:20 -07:00
lib RDMA v6.10 merge window 2024-05-18 13:04:15 -07:00
LICENSES LICENSES: Add the copyleft-next-0.3.1 license 2022-11-08 15:44:01 +01:00
mm IOMMU Updates for Linux v6.10 2024-05-18 10:55:13 -07:00
net NFSD 6.10 Release Notes 2024-05-18 14:04:20 -07:00
rust Kbuild updates for v6.10 2024-05-18 12:39:20 -07:00
samples Kbuild updates for v6.10 2024-05-18 12:39:20 -07:00
scripts Kbuild updates for v6.10 2024-05-18 12:39:20 -07:00
security Kbuild updates for v6.10 2024-05-18 12:39:20 -07:00
sound ALSA: hda/realtek: Drop doubly quirk entry for 103c:8a2e 2024-05-13 12:54:46 +02:00
tools Landlock updates for v6.10-rc1 2024-05-18 10:48:07 -07:00
usr kbuild: use $(src) instead of $(srctree)/$(src) for source directory 2024-05-10 04:34:52 +09:00
virt KVM x86 misc changes for 6.10: 2024-05-12 03:18:44 -04:00
.clang-format clang-format: Update with v6.7-rc4's for_each macro list 2023-12-08 23:54:38 +01:00
.cocciconfig
.editorconfig Add .editorconfig file for basic formatting 2023-12-28 16:22:47 +09:00
.get_maintainer.ignore Add Jeff Kirsher to .get_maintainer.ignore 2024-03-08 11:36:54 +00:00
.gitattributes .gitattributes: set diff driver for Rust source code files 2023-05-31 17:48:25 +02:00
.gitignore kbuild: create a list of all built DTB files 2024-02-19 18:20:39 +09:00
.mailmap Another not-too-busy cycle for documentation, including: 2024-05-13 10:51:53 -07:00
.rustfmt.toml rust: add .rustfmt.toml 2022-09-28 09:02:20 +02:00
COPYING COPYING: state that all contributions really are covered by this file 2020-02-10 13:32:20 -08:00
CREDITS MAINTAINERS: Drop Gustavo Pimentel as PCI DWC Maintainer 2024-03-27 13:41:02 -05:00
Kbuild Kbuild updates for v6.1 2022-10-10 12:00:45 -07:00
Kconfig kbuild: ensure full rebuild when the compiler is updated 2020-05-12 13:28:33 +09:00
MAINTAINERS Random number generator updates for Linux 6.10-rc1. 2024-05-18 10:51:35 -07:00
Makefile Kbuild updates for v6.10 2024-05-18 12:39:20 -07:00
README README: Fix spelling 2024-03-18 03:36:32 -06:00

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the reStructuredText markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.