Commit 10a27261 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] ext3 direct io assert fix

Fix bug identified by Badari Pulavarty <pbadari@us.ibm.com>

Local variable `handle' will become stale if ext3_direct_io_get_blocks()
closes off the current transaction and starts a new one.  This causes a BUG in
journal_stop().

So reacquire the handle from *current after performing the I/O.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 788c16bd
......@@ -1579,6 +1579,12 @@ static ssize_t ext3_direct_IO(int rw, struct kiocb *iocb,
offset, nr_segs,
ext3_direct_io_get_blocks, NULL);
/*
* Reacquire the handle: ext3_direct_io_get_block() can restart the
* transaction
*/
handle = journal_current_handle();
out_stop:
if (handle) {
int err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment