提交 2c84599c 编写于 作者: S Sheng Yong 提交者: Artem Bityutskiy

UBIFS: do not write master node if need recovery

The commits 781c5717 ("UBIFS: intialize LPT earlier") and 09801194 ("UBIFS:
fix-up free space earlier") move some initialization before marking the
master node dirty. But the modification changes the conditions of writing
master.

If unclean umount happens, ubifs may fail when mounting. But trying to
mount it will write new master nodes on the flash. This is useless but
increasing sqnum. So check need_recovery before writing master node, and
don't create new master node if filesystem needs recovery.

The behavour of the bug shows at:
http://lists.infradead.org/pipermail/linux-mtd/2015-February/057712.htmlSigned-off-by: NSheng Yong <shengyong1@huawei.com>
Reviewed-by: NBen Gardiner <ben.l.gardiner@gmail.com>
Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
上级 9401a795
......@@ -1284,7 +1284,7 @@ static int mount_ubifs(struct ubifs_info *c)
goto out_lpt;
}
if (!c->ro_mount) {
if (!c->ro_mount && !c->need_recovery) {
/*
* Set the "dirty" flag so that if we reboot uncleanly we
* will notice this immediately on the next mount.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册