UBIFS: fix false space checking failure
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Wed, 20 Apr 2011 15:02:45 +0000 (18:02 +0300)
committerSteve Conklin <sconklin@canonical.com>
Thu, 2 Jun 2011 19:23:04 +0000 (14:23 -0500)
commit316fd57e59096a36794e7a588e9ce47c82f6a09d
treea862c2934ff28720a6fee689a2f11ba45768b6a0
parentcaa1477f8698c888e41094a31922131f4b4b9f27
UBIFS: fix false space checking failure

BugLink: http://bugs.launchpad.net/bugs/775809

commit 8c230d9a5b5ec7970139acb7e2d165d7a3fe9f9e upstream.

This patch fixes UBIFS mount failure when the debugging support is enabled,
we are recovering from a power cut, we were first mounter R/O and we are
re-mounting R/W. In this case we should not assume that the amount of free
space before we have re-mounted R/W and after are equivalent, because
when we have mounted R/O the file-system is in a non-committed state so
the amount of free space is slightly smaller, due to the fact that we cannot
predict the amount of free space precisely before we commit.

This patch fixes the issue by skipping the debugging check in case of
recovery. This issue was reported by Caizhiyong <caizhiyong@huawei.com>
here: http://thread.gmane.org/gmane.linux.drivers.mtd/34350/focus=34387

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Reported-by: Caizhiyong <caizhiyong@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
fs/ubifs/super.c