]> git.hungrycats.org Git - linux/commitdiff
[PATCH] ext3 direct io assert fix
authorAndrew Morton <akpm@osdl.org>
Sat, 16 Oct 2004 08:02:35 +0000 (01:02 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Sat, 16 Oct 2004 08:02:35 +0000 (01:02 -0700)
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: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/ext3/inode.c

index 7650d0dad3514e8fa939aadb3b41b7e1d76f9477..0e48f620d9e8a352f807404c77a095624a44d409 100644 (file)
@@ -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;