summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Ofitserov <himikof@gmail.com>2025-07-03 02:59:11 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2025-07-05 12:42:44 -0400
commitaa31021ba21c7f1f9ec753f4b1e643e0e9fc6af4 (patch)
tree6bc000831cbe9c3738d80abdbc7e96b9545bcd5c
parentcd5a8749013c4a53f48048f696e9919a7ff0990e (diff)
bcachefs: Suppress unnecessary inode_i_sectors_wrong fsck error
It is possible that fsck first miscounted the expected sector count (due to applying other fixes at the same time, for example) and then corrected itself using extents. No need to log an fsck error and write the inode in this case. Signed-off-by: Nikita Ofitserov <himikof@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-rw-r--r--fs/bcachefs/fsck.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/bcachefs/fsck.c b/fs/bcachefs/fsck.c
index 1ceca63c87a3..471e93a3f00c 100644
--- a/fs/bcachefs/fsck.c
+++ b/fs/bcachefs/fsck.c
@@ -1638,7 +1638,8 @@ static int check_i_sectors_notnested(struct btree_trans *trans, struct inode_wal
i->count = count2;
}
- if (fsck_err_on(!(i->inode.bi_flags & BCH_INODE_i_sectors_dirty),
+ if (fsck_err_on(!(i->inode.bi_flags & BCH_INODE_i_sectors_dirty) &&
+ i->inode.bi_sectors != i->count,
trans, inode_i_sectors_wrong,
"inode %llu:%u has incorrect i_sectors: got %llu, should be %llu",
w->last_pos.inode, i->inode.bi_snapshot,