diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-11-09 16:26:18 -0600 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-11-09 16:26:18 -0600 |
commit | d757a3b01e72368176c5ee580ea17f8c2d185cd7 (patch) | |
tree | 331c1f77b2814282a02d1b1cae0437b5217d2db5 /fs/ceph/file.c | |
parent | 26eaed4671af3c4108b266504aed1103fb68a378 (diff) | |
parent | 23c625ce3065e40c933a4239efb9b11f1194a343 (diff) | |
download | linux-d757a3b01e72368176c5ee580ea17f8c2d185cd7.tar.gz linux-d757a3b01e72368176c5ee580ea17f8c2d185cd7.tar.bz2 linux-d757a3b01e72368176c5ee580ea17f8c2d185cd7.zip |
Merge tag 'ceph-for-4.20-rc2' of https://github.com/ceph/ceph-client
Pull Ceph fixes from Ilya Dryomov:
"Two CephFS fixes (copy_file_range and quota) and a small feature bit
cleanup"
* tag 'ceph-for-4.20-rc2' of https://github.com/ceph/ceph-client:
libceph: assume argonaut on the server side
ceph: quota: fix null pointer dereference in quota check
ceph: add destination file data sync before doing any remote copy
Diffstat (limited to 'fs/ceph/file.c')
-rw-r--r-- | fs/ceph/file.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 27cad84dab23..189df668b6a0 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c @@ -1931,10 +1931,17 @@ static ssize_t ceph_copy_file_range(struct file *src_file, loff_t src_off, if (!prealloc_cf) return -ENOMEM; - /* Start by sync'ing the source file */ + /* Start by sync'ing the source and destination files */ ret = file_write_and_wait_range(src_file, src_off, (src_off + len)); - if (ret < 0) + if (ret < 0) { + dout("failed to write src file (%zd)\n", ret); + goto out; + } + ret = file_write_and_wait_range(dst_file, dst_off, (dst_off + len)); + if (ret < 0) { + dout("failed to write dst file (%zd)\n", ret); goto out; + } /* * We need FILE_WR caps for dst_ci and FILE_RD for src_ci as other |