diff options
author | Luis Henriques <lhenriques@suse.com> | 2020-02-24 14:44:32 +0100 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2020-03-30 12:42:41 +0200 |
commit | 1b0c3b9f91f0df03088d293fc9e62743fd789ad2 (patch) | |
tree | 3a1ce30b7d1e4904fd3f554d14cc7a11434710d8 /fs/ceph/mds_client.c | |
parent | ceph: move to a dedicated slabcache for mds requests (diff) | |
download | linux-1b0c3b9f91f0df03088d293fc9e62743fd789ad2.tar.xz linux-1b0c3b9f91f0df03088d293fc9e62743fd789ad2.zip |
ceph: re-org copy_file_range and fix some error paths
This patch re-organizes copy_file_range, trying to fix a few issues in the
error handling. Here's the summary:
- Abort copy if initial do_splice_direct() returns fewer bytes than
requested.
- Move the 'size' initialization (with i_size_read()) further down in the
code, after the initial call to do_splice_direct(). This avoids issues
with a possibly stale value if a manual copy is done.
- Move the object copy loop into a separate function. This makes it
easier to handle errors (e.g, dirtying caps and updating the MDS
metadata if only some objects have been copied before an error has
occurred).
- Added calls to ceph_oloc_destroy() to avoid leaking memory with src_oloc
and dst_oloc
- After the object copy loop, the new file size to be reported to the MDS
(if there's file size change) is now the actual file size, and not the
size after an eventual extra manual copy.
- Added a few dout() to show the number of bytes copied in the two manual
copies and in the object copy loop.
Signed-off-by: Luis Henriques <lhenriques@suse.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph/mds_client.c')
0 files changed, 0 insertions, 0 deletions