summaryrefslogtreecommitdiff
path: root/fs/ubifs/super.c
diff options
context:
space:
mode:
authorAdrian Hunter <ext-adrian.hunter@nokia.com>2009-01-26 10:55:40 +0200
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2009-01-26 12:54:11 +0200
commit49d128aa60751a010640f4763d11577e2f508853 (patch)
treee74af898443112bf1e323e019b6c1a74f7e5d415 /fs/ubifs/super.c
parentb4978e949104844224ecf786170c9263efa601f3 (diff)
UBIFS: ensure orphan area head is initialized
When mounting read-only the orphan area head is not initialized. It must be initialized when remounting read/write, but it was not. This patch fixes that. [Artem: sorry, added comment tweaking noise] Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'fs/ubifs/super.c')
-rw-r--r--fs/ubifs/super.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index 336073e4c391..fd7fc7f3b7a6 100644
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -1524,6 +1524,12 @@ static int ubifs_remount_rw(struct ubifs_info *c)
err = ubifs_recover_inl_heads(c, c->sbuf);
if (err)
goto out;
+ } else {
+ /* A readonly mount is not allowed to have orphans */
+ ubifs_assert(c->tot_orphans == 0);
+ err = ubifs_clear_orphans(c);
+ if (err)
+ goto out;
}
if (!(c->mst_node->flags & cpu_to_le32(UBIFS_MST_DIRTY))) {