Skip to content

Commit 691a41d

Browse files
dhowellssmfrench
authored andcommitted
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 b073a08 is meant to cause cifs to return an error if REMAP_FILE_DEDUP. Fixes: b073a08 ("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]>
1 parent 9241433 commit 691a41d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fs/smb/client/cifsfs.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1277,7 +1277,9 @@ static loff_t cifs_remap_file_range(struct file *src_file, loff_t off,
12771277
unsigned int xid;
12781278
int rc;
12791279

1280-
if (remap_flags & ~(REMAP_FILE_DEDUP | REMAP_FILE_ADVISORY))
1280+
if (remap_flags & REMAP_FILE_DEDUP)
1281+
return -EOPNOTSUPP;
1282+
if (remap_flags & ~REMAP_FILE_ADVISORY)
12811283
return -EINVAL;
12821284

12831285
cifs_dbg(FYI, "clone range\n");

0 commit comments

Comments
 (0)