summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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");