This is a note to let you know that I've just added the patch titled cifs: Fix non-availability of dedup breaking generic/304 to the 6.1-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: cifs-fix-non-availability-of-dedup-breaking-generic-304.patch and it can be found in the queue-6.1 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 691a41d8da4b34fe72f09393505f55f28a8f34ec Mon Sep 17 00:00:00 2001 From: David Howells <dhowells@xxxxxxxxxx> Date: Mon, 4 Dec 2023 14:01:59 +0000 Subject: cifs: Fix non-availability of dedup breaking generic/304 From: David Howells <dhowells@xxxxxxxxxx> commit 691a41d8da4b34fe72f09393505f55f28a8f34ec upstream. Deduplication isn't supported on cifs, but cifs doesn't reject it, instead treating it as extent duplication/cloning. This can cause generic/304 to go silly and run for hours on end. Fix cifs to indicate EOPNOTSUPP if REMAP_FILE_DEDUP is set in ->remap_file_range(). Note that it's unclear whether or not commit b073a08016a1 is meant to cause cifs to return an error if REMAP_FILE_DEDUP. Fixes: b073a08016a1 ("cifs: fix that return -EINVAL when do dedupe operation") Cc: stable@xxxxxxxxxxxxxxx Suggested-by: Dave Chinner <david@xxxxxxxxxxxxx> cc: Xiaoli Feng <fengxiaoli0714@xxxxxxxxx> cc: Shyam Prasad N <nspmangalore@xxxxxxxxx> cc: Rohith Surabattula <rohiths.msft@xxxxxxxxx> cc: Jeff Layton <jlayton@xxxxxxxxxx> cc: Darrick Wong <darrick.wong@xxxxxxxxxx> cc: fstests@xxxxxxxxxxxxxxx cc: linux-cifs@xxxxxxxxxxxxxxx cc: linux-fsdevel@xxxxxxxxxxxxxxx Link: https://lore.kernel.org/r/3876191.1701555260@xxxxxxxxxxxxxxxxxxxxxx/ Signed-off-by: David Howells <dhowells@xxxxxxxxxx> Signed-off-by: Steve French <stfrench@xxxxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- fs/smb/client/cifsfs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/fs/smb/client/cifsfs.c +++ b/fs/smb/client/cifsfs.c @@ -1203,7 +1203,9 @@ static loff_t cifs_remap_file_range(stru unsigned int xid; int rc; - if (remap_flags & ~(REMAP_FILE_DEDUP | REMAP_FILE_ADVISORY)) + if (remap_flags & REMAP_FILE_DEDUP) + return -EOPNOTSUPP; + if (remap_flags & ~REMAP_FILE_ADVISORY) return -EINVAL; cifs_dbg(FYI, "clone range\n"); Patches currently in stable-queue which might be from dhowells@xxxxxxxxxx are queue-6.1/cifs-fix-flushing-invalidation-and-file-size-with-copy_file_range.patch queue-6.1/cifs-fix-flushing-invalidation-and-file-size-with-ficlone.patch queue-6.1/cifs-fix-non-availability-of-dedup-breaking-generic-304.patch