nfsd4: make recall callback an asynchronous rpc
[safe/jmp/linux-2.6] / fs / ubifs / log.c
index 36857b9..56e3377 100644 (file)
@@ -239,7 +239,7 @@ int ubifs_add_bud_to_log(struct ubifs_info *c, int jhead, int lnum, int offs)
        }
 
        /*
-        * Make sure the the amount of space in buds will not exceed
+        * Make sure the amount of space in buds will not exceed the
         * 'c->max_bud_bytes' limit, because we want to guarantee mount time
         * limits.
         *
@@ -317,6 +317,8 @@ int ubifs_add_bud_to_log(struct ubifs_info *c, int jhead, int lnum, int offs)
        return 0;
 
 out_unlock:
+       if (err != -EAGAIN)
+               ubifs_ro_mode(c, err);
        mutex_unlock(&c->log_mutex);
        kfree(ref);
        kfree(bud);
@@ -365,7 +367,6 @@ static void remove_buds(struct ubifs_info *c)
                                bud->jhead, c->leb_size - bud->start,
                                c->cmt_bud_bytes);
                        rb_erase(p1, &c->buds);
-                       list_del(&bud->list);
                        /*
                         * If the commit does not finish, the recovery will need
                         * to replay the journal, in which case the old buds
@@ -373,7 +374,7 @@ static void remove_buds(struct ubifs_info *c)
                         * commit i.e. do not allow them to be garbage
                         * collected.
                         */
-                       list_add(&bud->list, &c->old_buds);
+                       list_move(&bud->list, &c->old_buds);
                }
        }
        spin_unlock(&c->buds_lock);
@@ -410,7 +411,7 @@ int ubifs_log_start_commit(struct ubifs_info *c, int *ltail_lnum)
                return -ENOMEM;
 
        cs->ch.node_type = UBIFS_CS_NODE;
-       cs->cmt_no = cpu_to_le64(c->cmt_no + 1);
+       cs->cmt_no = cpu_to_le64(c->cmt_no);
        ubifs_prepare_node(c, cs, UBIFS_CS_NODE_SZ, 0);
 
        /*