xfs
[Top] [All Lists]

[PATCH] jfs: flush journal completely before releasing metadata inodes

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: [PATCH] jfs: flush journal completely before releasing metadata inodes
From: Dave Kleikamp <dave.kleikamp@xxxxxxxxxx>
Date: Mon, 01 Aug 2011 13:29:26 -0500
Cc: jfs-discussion@xxxxxxxxxxxxxxxxxxxxx, xfs@xxxxxxxxxxx
In-reply-to: <4E32D9EB.9020406@xxxxxxxxxx>
References: <20110729155039.GA28306@xxxxxxxxxxxxx> <4E32D9EB.9020406@xxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/20110628 Thunderbird/5.0
On 07/29/2011 11:03 AM, Dave Kleikamp wrote:
> On 07/29/2011 10:50 AM, Christoph Hellwig wrote:
>> The patch below adds basic jfs support to xfstests.  Unfortunately it
>> doesn't get very far, as test 001 already blows up with a kernel crash,
>> as do 011 and 013 as other random picks.
> 
> Great :-)
> 
> Seems to be a good idea to support jfs. I'll carve out some time to
> reproduce and debug the crashes.

This fixes a race during unmount. We need to not only make sure that
the journal is completely written, but that the metadata changes make
it to disk before releasing ipimap and ipbmap.

Signed-off-by: Dave Kleikamp <dave.kleikamp@xxxxxxxxxx>
---
 fs/jfs/jfs_umount.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/jfs/jfs_umount.c b/fs/jfs/jfs_umount.c
index adcf92d..7971f37 100644
--- a/fs/jfs/jfs_umount.c
+++ b/fs/jfs/jfs_umount.c
@@ -68,7 +68,7 @@ int jfs_umount(struct super_block *sb)
                /*
                 * Wait for outstanding transactions to be written to log:
                 */
-               jfs_flush_journal(log, 1);
+               jfs_flush_journal(log, 2);
 
        /*
         * close fileset inode allocation map (aka fileset inode)
@@ -146,7 +146,7 @@ int jfs_umount_rw(struct super_block *sb)
         *
         * remove file system from log active file system list.
         */
-       jfs_flush_journal(log, 1);
+       jfs_flush_journal(log, 2);
 
        /*
         * Make sure all metadata makes it to disk

<Prev in Thread] Current Thread [Next in Thread>