1 From: Sunil Mushran <sunil.mushran@oracle.com>
2 Date: Wed, 22 Oct 2008 13:24:29 -0700
3 Subject: ocfs2: Set journal descriptor to NULL after journal shutdown
7 Patch sets journal descriptor to NULL after the journal is shutdown.
8 This ensures that jbd2_journal_release_jbd_inode(), which removes the
9 jbd2 inode from txn lists, can be called safely from ocfs2_clear_inode()
10 even after the journal has been shutdown.
12 Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
13 Signed-off-by: Joel Becker <joel.becker@oracle.com>
14 Signed-off-by: Mark Fasheh <mfasheh@suse.com>
16 fs/ocfs2/inode.c | 6 ++++++
17 fs/ocfs2/journal.c | 1 +
18 2 files changed, 7 insertions(+), 0 deletions(-)
20 Index: linux-2.6.27-ocfs2/fs/ocfs2/inode.c
21 ===================================================================
22 --- linux-2.6.27-ocfs2.orig/fs/ocfs2/inode.c
23 +++ linux-2.6.27-ocfs2/fs/ocfs2/inode.c
24 @@ -1106,6 +1106,12 @@ void ocfs2_clear_inode(struct inode *ino
25 oi->ip_last_trans = 0;
26 oi->ip_dir_start_lookup = 0;
30 + * ip_jinode is used to track txns against this inode. We ensure that
31 + * the journal is flushed before journal shutdown. Thus it is safe to
32 + * have inodes get cleaned up after journal shutdown.
34 jbd2_journal_release_jbd_inode(OCFS2_SB(inode->i_sb)->journal->j_journal,
37 Index: linux-2.6.27-ocfs2/fs/ocfs2/journal.c
38 ===================================================================
39 --- linux-2.6.27-ocfs2.orig/fs/ocfs2/journal.c
40 +++ linux-2.6.27-ocfs2/fs/ocfs2/journal.c
41 @@ -690,6 +690,7 @@ void ocfs2_journal_shutdown(struct ocfs2
43 /* Shutdown the kernel journal system */
44 jbd2_journal_destroy(journal->j_journal);
45 + journal->j_journal = NULL;
47 OCFS2_I(inode)->ip_open_count--;