]> git.baikalelectronics.ru Git - kernel.git/commit
ceph: add destination file data sync before doing any remote copy
authorLuis Henriques <lhenriques@suse.com>
Tue, 23 Oct 2018 16:53:14 +0000 (16:53 +0000)
committerIlya Dryomov <idryomov@gmail.com>
Thu, 8 Nov 2018 16:50:37 +0000 (17:50 +0100)
commita370a5d6d687a53b39838a4d239f8bee5ccbc461
tree6f540f39026f4c7eebfc471f0869ac0d304a5b0c
parentf630c74755763954e46ada22cb887770a3c4fdd4
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: 18159f6b144c ("ceph: support copy_file_range file operation")
Signed-off-by: Luis Henriques <lhenriques@suse.com>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
fs/ceph/file.c