]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/ubifs/log.c
Merge tag 'pci-v3.17-changes-2' of git://git.kernel.org/pub/scm/linux/kernel/git...
[karo-tx-linux.git] / fs / ubifs / log.c
index a902c5919e423ca619fcf0508345909b51ec99f8..a47ddfc9be6b2373c92e2b9eb8e5ab4454be581a 100644 (file)
@@ -240,6 +240,7 @@ int ubifs_add_bud_to_log(struct ubifs_info *c, int jhead, int lnum, int offs)
 
        if (c->lhead_offs > c->leb_size - c->ref_node_alsz) {
                c->lhead_lnum = ubifs_next_log_lnum(c, c->lhead_lnum);
+               ubifs_assert(c->lhead_lnum != c->ltail_lnum);
                c->lhead_offs = 0;
        }
 
@@ -404,15 +405,14 @@ int ubifs_log_start_commit(struct ubifs_info *c, int *ltail_lnum)
        /* Switch to the next log LEB */
        if (c->lhead_offs) {
                c->lhead_lnum = ubifs_next_log_lnum(c, c->lhead_lnum);
+               ubifs_assert(c->lhead_lnum != c->ltail_lnum);
                c->lhead_offs = 0;
        }
 
-       if (c->lhead_offs == 0) {
-               /* Must ensure next LEB has been unmapped */
-               err = ubifs_leb_unmap(c, c->lhead_lnum);
-               if (err)
-                       goto out;
-       }
+       /* Must ensure next LEB has been unmapped */
+       err = ubifs_leb_unmap(c, c->lhead_lnum);
+       if (err)
+               goto out;
 
        len = ALIGN(len, c->min_io_size);
        dbg_log("writing commit start at LEB %d:0, len %d", c->lhead_lnum, len);