From 97b8348d28006c87bf6d60a1e13df8e56fa2585f Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Tue, 15 Jul 2025 18:39:02 -0400 Subject: [PATCH] posix_to_bcachefs: fix inode.bi_sectors updates Signed-off-by: Kent Overstreet --- c_src/posix_to_bcachefs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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");