btrfs: send: update comment at find_extent_clone()
We have this unclear comment at find_extent_clone() about extents starting at a file offset greater than or equals to the i_size of the inode. It's not really informative and it's misleading, since it mentions the author found such extents with snapshots and large files. Such extents are a result of fallocate with FALLOC_FL_KEEP_SIZE and there is no relation to snapshots or large files (all write paths update the i_size before inserting a new file extent item). So update the comment to be precise about it and why we don't bother looking for clone sources in that case. Signed-off-by: Filipe Manana <fdmanana@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
committed by
David Sterba
parent
61ce908a3c
commit
d3f41317f0
@@ -1365,14 +1365,14 @@ static int find_extent_clone(struct send_ctx *sctx,
|
|||||||
int compressed;
|
int compressed;
|
||||||
u32 i;
|
u32 i;
|
||||||
|
|
||||||
if (data_offset >= ino_size) {
|
/*
|
||||||
/*
|
* With fallocate we can get prealloc extents beyond the inode's i_size,
|
||||||
* There may be extents that lie behind the file's size.
|
* so we don't do anything here because clone operations can not clone
|
||||||
* I at least had this in combination with snapshotting while
|
* to a range beyond i_size without increasing the i_size of the
|
||||||
* writing large files.
|
* destination inode.
|
||||||
*/
|
*/
|
||||||
|
if (data_offset >= ino_size)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
|
||||||
|
|
||||||
fi = btrfs_item_ptr(eb, path->slots[0], struct btrfs_file_extent_item);
|
fi = btrfs_item_ptr(eb, path->slots[0], struct btrfs_file_extent_item);
|
||||||
extent_type = btrfs_file_extent_type(eb, fi);
|
extent_type = btrfs_file_extent_type(eb, fi);
|
||||||
|
Reference in New Issue
Block a user