1 ext4: Set journal pointer to NULL when journal is released
3 From: Jan Kara <jack@suse.cz>
5 Set sbi->s_journal to NULL after we call journal_destroy(). This
6 will be later needed because after journal_destroy() is called,
7 ext4_clear_inode() can still be called for some inodes (e.g. root
8 inode) and we'll need to detect there that journal doesn't exists
11 Signed-off-by: Jan Kara <jack@suse.cz>
12 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
14 fs/ext4/super.c | 2 ++
15 1 file changed, 2 insertions(+)
17 Index: linux-2.6.26-rc6/fs/ext4/super.c
18 ===================================================================
19 --- linux-2.6.26-rc6.orig/fs/ext4/super.c 2008-06-20 14:22:12.000000000 -0700
20 +++ linux-2.6.26-rc6/fs/ext4/super.c 2008-06-23 15:10:51.000000000 -0700
21 @@ -506,6 +506,7 @@ static void ext4_put_super (struct super
23 ext4_xattr_put_super(sb);
24 jbd2_journal_destroy(sbi->s_journal);
25 + sbi->s_journal = NULL;
26 if (!(sb->s_flags & MS_RDONLY)) {
27 EXT4_CLEAR_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER);
28 es->s_state = cpu_to_le16(sbi->s_mount_state);
29 @@ -2423,6 +2424,7 @@ cantfind_ext4:
32 jbd2_journal_destroy(sbi->s_journal);
33 + sbi->s_journal = NULL;
35 percpu_counter_destroy(&sbi->s_freeblocks_counter);
36 percpu_counter_destroy(&sbi->s_freeinodes_counter);