Skip to content

Commit

Permalink
UBIFS: fix bogus assertion
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Artem Bityutskiy authored and Artem Bityutskiy committed Mar 15, 2009
1 parent f55aa59 commit b221337
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions fs/ubifs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -1318,11 +1318,15 @@ static int mount_ubifs(struct ubifs_info *c)
else {
c->need_recovery = 0;
ubifs_msg("recovery completed");
/* GC LEB has to be empty and taken at this point */
ubifs_assert(c->lst.taken_empty_lebs == 1);
/*
* GC LEB has to be empty and taken at this point. But
* the journal head LEBs may also be accounted as
* "empty taken" if they are empty.
*/
ubifs_assert(c->lst.taken_empty_lebs > 0);
}
} else
ubifs_assert(c->lst.taken_empty_lebs == 1);
ubifs_assert(c->lst.taken_empty_lebs > 0);

err = dbg_check_filesystem(c);
if (err)
Expand Down Expand Up @@ -1775,7 +1779,7 @@ static int ubifs_remount_fs(struct super_block *sb, int *flags, char *data)
c->bu.buf = NULL;
}

ubifs_assert(c->lst.taken_empty_lebs == 1);
ubifs_assert(c->lst.taken_empty_lebs > 0);
return 0;
}

Expand Down

0 comments on commit b221337

Please sign in to comment.