From: Andrew Morton Date: Sat, 16 Oct 2004 08:02:35 +0000 (-0700) Subject: [PATCH] ext3 direct io assert fix X-Git-Tag: v2.6.9~16 X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=10a27261d31c6f24c6971cc7ad8d1fbaf26fd3fb;p=history.git [PATCH] ext3 direct io assert fix Fix bug identified by Badari Pulavarty 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: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c index 7650d0dad351..0e48f620d9e8 100644 --- a/fs/ext3/inode.c +++ b/fs/ext3/inode.c @@ -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;