summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2025-07-15 18:39:02 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2025-07-15 18:39:45 -0400
commit97b8348d28006c87bf6d60a1e13df8e56fa2585f (patch)
tree89ce5ba9f246cf30702837c05de4c7b43f83b8d4
parent5f926277835d42b57744faa208b16e616fc479b8 (diff)
posix_to_bcachefs: fix inode.bi_sectors updates
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-rw-r--r--c_src/posix_to_bcachefs.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/c_src/posix_to_bcachefs.c b/c_src/posix_to_bcachefs.c
index 8cb1c7c8..084b56cf 100644
--- a/c_src/posix_to_bcachefs.c
+++ b/c_src/posix_to_bcachefs.c
@@ -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");