]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/ubifs/super.c
UBIFS: ensure orphan area head is initialized
[linux-2.6-omap-h63xx.git] / fs / ubifs / super.c
index 336073e4c39139e0226e740b5e6c753a3c21684a..fd7fc7f3b7a64fddbe0281b2423aa27996a31c61 100644 (file)
@@ -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))) {