mirror of
https://github.com/koverstreet/bcachefs-tools.git
synced 2025-02-02 00:00:03 +03:00
cmd_migrate: don't link data above i_size
The new filesystem might have a smaller blocksize than the old blocksize, which trips this. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
f06fd08067
commit
4158833a51
@ -378,6 +378,10 @@ static void copy_file(struct bch_fs *c, struct bch_inode_unpacked *dst,
|
|||||||
fiemap_iter_exit(&iter);
|
fiemap_iter_exit(&iter);
|
||||||
|
|
||||||
fiemap_for_each(src_fd, iter, e) {
|
fiemap_for_each(src_fd, iter, e) {
|
||||||
|
u64 src_max = roundup(src_size, block_bytes(c));
|
||||||
|
|
||||||
|
e.fe_length = min(e.fe_length, src_max - e.fe_logical);
|
||||||
|
|
||||||
if ((e.fe_logical & (block_bytes(c) - 1)) ||
|
if ((e.fe_logical & (block_bytes(c) - 1)) ||
|
||||||
(e.fe_length & (block_bytes(c) - 1)))
|
(e.fe_length & (block_bytes(c) - 1)))
|
||||||
die("Unaligned extent in %s - can't handle", src_path);
|
die("Unaligned extent in %s - can't handle", src_path);
|
||||||
|
Loading…
Reference in New Issue
Block a user