posix_to_bcachefs: fix inode.bi_sectors updates

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2025-07-15 18:39:02 -04:00
parent 5f92627783
commit 97b8348d28

View File

@ -282,7 +282,7 @@ static void write_data(struct bch_fs *c,
closure_call(&op.cl, bch2_write, NULL, NULL);
BUG_ON(!(op.flags & BCH_WRITE_submitted));
dst_inode->bi_sectors += len >> 9;
dst_inode->bi_sectors += op.i_sectors_delta;
if (op.error)
die("write error: %s", bch2_err_str(op.error));
@ -371,6 +371,8 @@ static void copy_link(struct bch_fs *c,
if (ret)
die("bch2_fpunch error: %s", bch2_err_str(ret));
dst->bi_sectors += i_sectors_delta;
ret = readlink(src, src_buf, sizeof(src_buf));
if (ret < 0)
die("readlink error: %m");