summaryrefslogtreecommitdiffstats
path: root/fs/ubifs/super.c
diff options
context:
space:
mode:
authorRichard Weinberger <richard@nod.at>2018-07-12 13:02:00 +0200
committerRichard Weinberger <richard@nod.at>2018-08-15 00:25:22 +0200
commit99a24e02ccf6604e3020cf9e2c7a042b6ebb655f (patch)
tree7e54ebb184e769900cb3fa6f44368cbdf20b2412 /fs/ubifs/super.c
parentubifs: Allow setting assert action as mount parameter (diff)
downloadlinux-99a24e02ccf6604e3020cf9e2c7a042b6ebb655f.tar.xz
linux-99a24e02ccf6604e3020cf9e2c7a042b6ebb655f.zip
ubifs: Set default assert action to read-only
Traditionally UBIFS just reported a failed assertion and moved on. The drawback is that users will notice UBIFS bugs when it is too late, most of the time when it is no longer about to mount. This makes bug hunting problematic since valuable information from failing asserts is long gone when UBIFS is dead. The other extreme, panic'ing on a failing assert is also not worthwhile, we want users and developers give a chance to collect as much debugging information as possible if UBIFS hits an assert. Therefore go for the third option, switch to read-only mode when an assert fails. That way UBIFS will not write possible bad data to the MTD and gives users the chance to collect debugging information. Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'fs/ubifs/super.c')
-rw-r--r--fs/ubifs/super.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index c31e7b4f1e1c..23e7042666a7 100644
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -2027,6 +2027,7 @@ static struct ubifs_info *alloc_ubifs_info(struct ubi_volume_desc *ubi)
INIT_LIST_HEAD(&c->orph_list);
INIT_LIST_HEAD(&c->orph_new);
c->no_chk_data_crc = 1;
+ c->assert_action = ASSACT_RO;
c->highest_inum = UBIFS_FIRST_INO;
c->lhead_lnum = c->ltail_lnum = UBIFS_LOG_LNUM;