]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
ext4: Fix ext4_ext_journal_restart()
authorTheodore Ts'o <tytso@mit.edu>
Sat, 2 Aug 2008 00:57:54 +0000 (20:57 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 2 Aug 2008 00:57:54 +0000 (20:57 -0400)
The ext4_ext_journal_restart() is a convenience function which checks
to see if the requested number of credits is present, and if so it
closes the current transaction and attaches the current handle to the
new transaction.  Unfortunately, it wasn't proprely checking the
return value from ext4_journal_extend(), so it was starting a new
transaction when one was not necessary, and returning an error when
all that was necessary was to restart the handle with a new
transaction.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/ext4/extents.c

index 8ee1fa54a4e13a31f4dc4f67257613ef1394d2b9..f554703eb924db4726ef04347b58416f2de9ea8b 100644 (file)
@@ -99,7 +99,7 @@ static int ext4_ext_journal_restart(handle_t *handle, int needed)
        if (handle->h_buffer_credits > needed)
                return 0;
        err = ext4_journal_extend(handle, needed);
-       if (err)
+       if (err <= 0)
                return err;
        return ext4_journal_restart(handle, needed);
 }