Skip to content

Commit d3bdc01

Browse files
saschahauerrichardweinberger
authored andcommitted
ubifs: drop false positive assertion
The following sequence triggers ubifs_assert(c, c->lst.taken_empty_lebs > 0); at the end of ubifs_remount_fs(): mount -t ubifs /dev/ubi0_0 /mnt echo 1 > /sys/kernel/debug/ubifs/ubi0_0/ro_error umount /mnt mount -t ubifs -o ro /dev/ubix_y /mnt mount -o remount,ro /mnt The resulting UBIFS assert failed in ubifs_remount_fs at 1878 (pid 161) is a false positive. In the case above c->lst.taken_empty_lebs has never been changed from its initial zero value. This will only happen when the deferred recovery is done. Fix this by doing the assertion only when recovery has been done already. Signed-off-by: Sascha Hauer <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>
1 parent 37f31b6 commit d3bdc01

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fs/ubifs/super.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1912,7 +1912,9 @@ static int ubifs_remount_fs(struct super_block *sb, int *flags, char *data)
19121912
mutex_unlock(&c->bu_mutex);
19131913
}
19141914

1915-
ubifs_assert(c, c->lst.taken_empty_lebs > 0);
1915+
if (!c->need_recovery)
1916+
ubifs_assert(c, c->lst.taken_empty_lebs > 0);
1917+
19161918
return 0;
19171919
}
19181920

0 commit comments

Comments
 (0)