UBIFS assert when rebooting a read only ubifs when it's been remounted r/w

Richard Weinberger richard.weinberger at gmail.com
Tue May 17 09:13:30 PDT 2016


On Tue, May 17, 2016 at 5:19 PM, Martin Townsend
<mtownsend1973 at gmail.com> wrote:
> Hi,
>
> I've just seen the following UBIFS assert which relates to
> ubifs_remount_fs in fs/ubifs/super.c
> We have a read only root filesystem and it looks like this problem
> occurs after rebooting the board when the root filesystem has been
> remounted as as r/w, I use the following command to do this in case
> I'm doing this incorrectly.
> mount -o remount,rw /
> The only way to stop it is to login and run
> mount -o remount,rw /
> mount -o remount,ro /
> and then reboots do not assert.
>
> I've tried a few times now and can happily reproduce it.
>
> Any ideas on how to fix this?

Let's analyze the root cause first.
Can you please reproduce with the attached debug patch applied?
I wonder what the value of c->lst.taken_empty_lebs is.

-- 
Thanks,
//richard
-------------- next part --------------
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index e98c24e..7514fab 100644
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -1870,7 +1870,11 @@ static int ubifs_remount_fs(struct super_block *sb, int *flags, char *data)
 		c->bu.buf = NULL;
 	}
 
-	ubifs_assert(c->lst.taken_empty_lebs > 0);
+	if (!(c->lst.taken_empty_lebs > 0)) {
+		ubifs_err(c, "taken_empty_lebs is %i", c->lst.taken_empty_lebs);
+		ubifs_assert(0);
+	}
+
 	return 0;
 }
 


More information about the linux-mtd mailing list