aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jbd/checkpoint.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2005-06-02 17:02:01 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-02 18:12:29 -0400
commit7e3b11a9be6ac94bf4af81757b6a10e7e65b846f (patch)
tree6159b542abf0515e5980822546ca0f84380cd3d3 /fs/jbd/checkpoint.c
parent00ea81459c279f14a7b344320a71c94f60f88929 (diff)
[PATCH] ext3: fix list scanning in __cleanup_transaction
Fix a bug in list scanning that can cause us to skip the last buffer on the checkpoint list (and hence fail to do any progress under some rather unfavorable conditions). The problem is we first do jh=next_jh and then test } while (jh!=last_jh); Hence we skip the last buffer on the list (if it was not the only buffer on the list). As we already do jh=next_jh; in the beginning of the loop we are safe to just remove the assignment in the end. It can happen that 'jh' will be freed at the point we test jh != last_jh but that does not matter as we never *dereference* the pointer. Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/jbd/checkpoint.c')
-rw-r--r--fs/jbd/checkpoint.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/fs/jbd/checkpoint.c b/fs/jbd/checkpoint.c
index 58133ab9457e..5a97e346bd95 100644
--- a/fs/jbd/checkpoint.c
+++ b/fs/jbd/checkpoint.c
@@ -188,7 +188,6 @@ static int __cleanup_transaction(journal_t *journal, transaction_t *transaction)
188 } else { 188 } else {
189 jbd_unlock_bh_state(bh); 189 jbd_unlock_bh_state(bh);
190 } 190 }
191 jh = next_jh;
192 } while (jh != last_jh); 191 } while (jh != last_jh);
193 192
194 return ret; 193 return ret;