Skip to content

Commit b221337

Browse files
Artem BityutskiyArtem Bityutskiy
authored andcommitted
UBIFS: fix bogus assertion
Empty journal head LEBs are accounted as taken empty as well, so the GC LEB does not have to be the only taken empty LEB when nounting/remounting. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
1 parent f55aa59 commit b221337

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

‎fs/ubifs/super.c‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1318,11 +1318,15 @@ static int mount_ubifs(struct ubifs_info *c)
13181318
else {
13191319
c->need_recovery = 0;
13201320
ubifs_msg("recovery completed");
1321-
/* GC LEB has to be empty and taken at this point */
1322-
ubifs_assert(c->lst.taken_empty_lebs == 1);
1321+
/*
1322+
* GC LEB has to be empty and taken at this point. But
1323+
* the journal head LEBs may also be accounted as
1324+
* "empty taken" if they are empty.
1325+
*/
1326+
ubifs_assert(c->lst.taken_empty_lebs > 0);
13231327
}
13241328
} else
1325-
ubifs_assert(c->lst.taken_empty_lebs == 1);
1329+
ubifs_assert(c->lst.taken_empty_lebs > 0);
13261330

13271331
err = dbg_check_filesystem(c);
13281332
if (err)
@@ -1775,7 +1779,7 @@ static int ubifs_remount_fs(struct super_block *sb, int *flags, char *data)
17751779
c->bu.buf = NULL;
17761780
}
17771781

1778-
ubifs_assert(c->lst.taken_empty_lebs == 1);
1782+
ubifs_assert(c->lst.taken_empty_lebs > 0);
17791783
return 0;
17801784
}
17811785

0 commit comments

Comments
 (0)