cifs: fix that return -EINVAL when do dedupe operation
Subsystems (2)
PATCH 1/1 cifs: fix that return -EINVAL when do dedupe operation
From: Xiaoli Feng <[email protected]>
dedupe_file_range operations is combiled into remap_file_range. But it's always skipped for dedupe operations in function cifs_remap_file_range.
Example to test:
Before this patch:XFS_IOC_FILE_EXTENT_SAME: Invalid argument
After this patch:XFS_IOC_FILE_EXTENT_SAME: Operation not supported
--- fs/cifs/cifsfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/cifs/cifsfs.c +1 -1
@@ -1008,7 +1008,7 @@ static loff_t cifs_remap_file_range(struct file *src_file, loff_t off,unsigned int xid;int rc; -if (remap_flags & ~REMAP_FILE_ADVISORY ) +if (remap_flags & ~(REMAP_FILE_DEDUP |REMAP_FILE_ADVISORY ))return -EINVAL ;cifs_dbg (FYI ,"clone range\n" );
Signature · 1 line
2.18.1
Do you have a list of any xfstests that this also helps with?
Quoted 35 lines · XiaoLi Feng
From: Xiaoli Feng <[email protected]>
dedupe_file_rangeoperations is combiled intoremap_file_range. But it's always skipped for dedupe operations in functioncifs_remap_file_range.Example to test:
Before this patch:XFS_IOC_FILE_EXTENT_SAME: Invalid argumentAfter this patch:
XFS_IOC_FILE_EXTENT_SAME: Operation not supportedSigned-off-by Xiaoli Feng <[email protected]>--- fs/cifs/cifsfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/cifs/cifsfs.c +1
-2@@ -1008,7 +1008,7 @@ static loff_t cifs_remap_file_range(struct file *src_file, loff_t off,unsigned int xid;int rc; -if (remap_flags & ~REMAP_FILE_ADVISORY ) +if (remap_flags & ~(REMAP_FILE_DEDUP |REMAP_FILE_ADVISORY ))return -EINVAL ;cifs_dbg (FYI ,"clone range\n" ); --2.18.1
Signature · 3 lines
Thanks, Steve