Skip to content

Commit

Permalink
[PATCH] ext3: fix list scanning in __cleanup_transaction
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jan Kara authored and Linus Torvalds committed Jun 2, 2005
1 parent 00ea814 commit 7e3b11a
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion fs/jbd/checkpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ static int __cleanup_transaction(journal_t *journal, transaction_t *transaction)
} else {
jbd_unlock_bh_state(bh);
}
jh = next_jh;
} while (jh != last_jh);

return ret;
Expand Down

0 comments on commit 7e3b11a

Please sign in to comment.