summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2008-08-02 02:57:54 +0200
committerTheodore Ts'o <tytso@mit.edu>2008-08-02 02:57:54 +0200
commit0123c93998511978556b03d2bb023af92aa24d55 (patch)
treeec01472f1c23b046fe25c1c2b4e2d4d054a5d163
parentext4: fix ext4_da_write_begin error path (diff)
downloadlinux-0123c93998511978556b03d2bb023af92aa24d55.tar.xz
linux-0123c93998511978556b03d2bb023af92aa24d55.zip
ext4: Fix ext4_ext_journal_restart()
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>
-rw-r--r--fs/ext4/extents.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 8ee1fa54a4e1..f554703eb924 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -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);
}