cifs: Fix non-availability of dedup breaking generic/304
Subsystems (3)
PATCH 1/1 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.
--- fs/smb/client/cifsfs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
fs/smb/client/cifsfs.c +3 -1
@@ -1276,7 +1276,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" );
added missing Signed-off-by line (and also for the two previous patches from David) and added Cc: stable and tentatively merged into cifs-2.6.git for-next pending additional testing
Quoted 44 lines · David Howells
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_DEDUPis set in ->remap_file_range().Note that it's unclear whether or not commit
b073a08016a1is meant to cause cifs to return an error ifREMAP_FILE_DEDUP.Fixes b073a08016a1 ("cifs: fix that return -EINVAL when do dedupe operation")Suggested-by Dave Chinner <[email protected]>cc Steve French <[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]>--- fs/smb/client/cifsfs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)fs/smb/client/cifsfs.c +3
-1@@ -1276,7 +1276,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" );
Signature · 3 lines
Thanks, Steve
Quoted 3 lines · David Howells
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.
This should also mention that it cloning rather than comparing data can cause server-side data corruption in the destination file for the benefit of anyone trying to track down weird data corruption problems....
Quoted 27 lines
Fix cifs to indicate EOPNOTSUPP if
REMAP_FILE_DEDUPis set in ->remap_file_range().Note that it's unclear whether or not commit
b073a08016a1is meant to cause cifs to return an error ifREMAP_FILE_DEDUP.Fixes b073a08016a1 ("cifs: fix that return -EINVAL when do dedupe operation")Suggested-by Dave Chinner <[email protected]>cc Steve French <[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]>--- fs/smb/client/cifsfs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)fs/smb/client/cifsfs.c +0
-0
fs/smb/client/cifsfs.c static loff_t cifs_remap_file_range(struct file *src_file, loff_t off, · line 1284
Quoted 10 lines
fs/smb/client/cifsfs.c +3
-1@@ -1276,7 +1276,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" );
Apart from updating the commit message, the fix looks fine to me.
Signature · 2 lines
Dave Chinner [email protected]