Linux/linux c2c6d3cfs/ceph file.c

ceph: add destination file data sync before doing any remote copy

If we try to copy into a file that was just written, any data that is
remote copied will be overwritten by our buffered writes once they are
flushed.  When this happens, the call to invalidate_inode_pages2_range
will also return a -EBUSY error.

This patch fixes this by also sync'ing the destination file before
starting any copy.

Fixes: 503f82a9932d ("ceph: support copy_file_range file operation")
Signed-off-by: Luis Henriques <lhenriques at suse.com>
Reviewed-by: "Yan, Zheng" <zyan at redhat.com>
Signed-off-by: Ilya Dryomov <idryomov at gmail.com>
DeltaFile
+9-2fs/ceph/file.c
+9-21 files

UnifiedSplitRaw