summaryrefslogtreecommitdiff
path: root/libbcachefs/fs-gc.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2017-03-31 05:12:36 -0800
committerKent Overstreet <kent.overstreet@gmail.com>2017-03-31 05:12:36 -0800
commit4921d02142fec87999cba32e991bb62c2a80184d (patch)
tree7d5b59a8ae6fc3116da28903f14d835a86511799 /libbcachefs/fs-gc.c
parentc0ad33c126300a51721a4f0ec8c0d757647e9cbe (diff)
Update bcachefs sources
Diffstat (limited to 'libbcachefs/fs-gc.c')
-rw-r--r--libbcachefs/fs-gc.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/libbcachefs/fs-gc.c b/libbcachefs/fs-gc.c
index 1a03b7ea..03370c0e 100644
--- a/libbcachefs/fs-gc.c
+++ b/libbcachefs/fs-gc.c
@@ -134,18 +134,22 @@ static int check_extents(struct bch_fs *c)
"extent type %u for missing inode %llu",
k.k->type, k.k->p.inode);
- unfixable_fsck_err_on(w.first_this_inode && w.have_inode &&
+ unfixable_fsck_err_on(w.have_inode &&
+ !S_ISREG(w.inode.i_mode) && !S_ISLNK(w.inode.i_mode), c,
+ "extent type %u for non regular file, inode %llu mode %o",
+ k.k->type, k.k->p.inode, w.inode.i_mode);
+
+ unfixable_fsck_err_on(w.first_this_inode &&
+ w.have_inode &&
+ !(w.inode.i_flags & BCH_INODE_I_SECTORS_DIRTY) &&
w.inode.i_sectors !=
(i_sectors = bch2_count_inode_sectors(c, w.cur_inum)),
c, "i_sectors wrong: got %llu, should be %llu",
w.inode.i_sectors, i_sectors);
unfixable_fsck_err_on(w.have_inode &&
- !S_ISREG(w.inode.i_mode) && !S_ISLNK(w.inode.i_mode), c,
- "extent type %u for non regular file, inode %llu mode %o",
- k.k->type, k.k->p.inode, w.inode.i_mode);
-
- unfixable_fsck_err_on(k.k->type != BCH_RESERVATION &&
+ !(w.inode.i_flags & BCH_INODE_I_SIZE_DIRTY) &&
+ k.k->type != BCH_RESERVATION &&
k.k->p.offset > round_up(w.inode.i_size, PAGE_SIZE) >> 9, c,
"extent type %u offset %llu past end of inode %llu, i_size %llu",
k.k->type, k.k->p.offset, k.k->p.inode, w.inode.i_size);