diff --git a/fs/ubifs/master.c b/fs/ubifs/master.c index 28beaee..2b668cc 100644 --- a/fs/ubifs/master.c +++ b/fs/ubifs/master.c @@ -135,7 +135,7 @@ static int validate_master(const struct ubifs_info *c) goto out; } - if (c->gc_lnum >= c->leb_cnt || c->gc_lnum < c->main_first) { + if (c->gc_lnum != -1 && (c->gc_lnum >= c->leb_cnt || c->gc_lnum < c->main_first)) { err = 7; goto out; } diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c index 8cdcdc5..0207620 100644 --- a/fs/ubifs/super.c +++ b/fs/ubifs/super.c @@ -1260,7 +1260,7 @@ static int mount_ubifs(struct ubifs_info *c) init_constants_master(c); - if ((c->mst_node->flags & cpu_to_le32(UBIFS_MST_DIRTY)) != 0) { + if ((c->mst_node->flags & cpu_to_le32(UBIFS_MST_DIRTY)) != 0 || c->gc_lnum == -1) { ubifs_msg("recovery needed"); c->need_recovery = 1; if (!mounted_read_only) {