summaryrefslogtreecommitdiffstats
path: root/fs/read_write.c
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2018-11-30 21:32:38 +0100
committerDarrick J. Wong <darrick.wong@oracle.com>2018-12-04 17:50:49 +0100
commit6744557b53a2b710ebce3736a5c27a0119685fcc (patch)
tree0ac2f8aa8dbdb860b34faa7274e723004fff2b00 /fs/read_write.c
parentxfs: fix inverted return from xfs_btree_sblock_verify_crc (diff)
downloadlinux-6744557b53a2b710ebce3736a5c27a0119685fcc.tar.xz
linux-6744557b53a2b710ebce3736a5c27a0119685fcc.zip
vfs: allow some remap flags to be passed to vfs_clone_file_range
In overlayfs, ovl_remap_file_range calls vfs_clone_file_range on the lower filesystem's inode, passing through whatever remap flags it got from its caller. Since vfs_copy_file_range first tries a filesystem's remap function with REMAP_FILE_CAN_SHORTEN, this can get passed through to the second vfs_copy_file_range call, and this isn't an issue. Change the WARN_ON to look only for the DEDUP flag. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Amir Goldstein <amir73il@gmail.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/read_write.c')
-rw-r--r--fs/read_write.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/read_write.c b/fs/read_write.c
index 4dae0399c75a..58f30537c47a 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -1956,7 +1956,7 @@ loff_t do_clone_file_range(struct file *file_in, loff_t pos_in,
struct inode *inode_out = file_inode(file_out);
loff_t ret;
- WARN_ON_ONCE(remap_flags);
+ WARN_ON_ONCE(remap_flags & REMAP_FILE_DEDUP);
if (S_ISDIR(inode_in->i_mode) || S_ISDIR(inode_out->i_mode))
return -EISDIR;