aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Howells <[email protected]>2023-12-04 14:01:59 +0000
committerSteve French <[email protected]>2023-12-05 21:12:04 -0600
commit691a41d8da4b34fe72f09393505f55f28a8f34ec (patch)
tree852d9c3997075bc2347be1f6e9afc6a2b5ef8805
parent92414333eb375ed64f4ae92d34d579e826936480 (diff)
cifs: Fix non-availability of dedup breaking generic/304
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: [email protected] Suggested-by: Dave Chinner <[email protected]> cc: Xiaoli Feng <[email protected]> cc: Shyam Prasad N <[email protected]> cc: Rohith Surabattula <[email protected]> cc: Jeff Layton <[email protected]> cc: Darrick Wong <[email protected]> cc: [email protected] cc: [email protected] cc: [email protected] Link: https://lore.kernel.org/r/[email protected]/ Signed-off-by: David Howells <[email protected]> Signed-off-by: Steve French <[email protected]>
-rw-r--r--fs/smb/client/cifsfs.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/smb/client/cifsfs.c b/fs/smb/client/cifsfs.c
index c5fc0a35bb19..2131638f26d0 100644
--- a/fs/smb/client/cifsfs.c
+++ b/fs/smb/client/cifsfs.c
@@ -1277,7 +1277,9 @@ static loff_t cifs_remap_file_range(struct file *src_file, loff_t off,
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");