]> git.hungrycats.org Git - linux/commitdiff
[PATCH] jbd: start_this_handle() return value fix
authorAndrew Morton <akpm@osdl.org>
Mon, 19 Jan 2004 13:08:44 +0000 (05:08 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Mon, 19 Jan 2004 13:08:44 +0000 (05:08 -0800)
From: Alex Tomas <alex@clusterfs.com>

start_this_handle() returns 0 always.  because of this journal_start() may
return handle with h_transaction = NULL

fs/jbd/transaction.c

index ba957c1fb3dcd1b174ec8268f0a30654967467d7..73ef79d97fd06e54d4b3b96301b51f5e60f9ef07 100644 (file)
@@ -85,7 +85,7 @@ static int start_this_handle(journal_t *journal, handle_t *handle)
        int needed;
        int nblocks = handle->h_buffer_credits;
        transaction_t *new_transaction = NULL;
-       int ret;
+       int ret = 0;
 
        if (nblocks > journal->j_max_transaction_buffers) {
                printk(KERN_ERR "JBD: %s wants too many credits (%d > %d)\n",
@@ -231,7 +231,7 @@ repeat_locked:
 out:
        if (new_transaction)
                kfree(new_transaction);
-       return 0;
+       return ret;
 }
 
 /* Allocate a new handle.  This should probably be in a slab... */