[PATCH 28/52] ext4: Set journal pointer to NULL when journal is released

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Ext4 Developers List <linux-ext4@...>, Linux Kernel Developers List <linux-kernel@...>
Cc: Jan Kara <jack@...>, Theodore Ts'o <tytso@...>
Date: Saturday, July 5, 2008 - 1:35 pm

From: Jan Kara <jack@suse.cz>

Set sbi->s_journal to NULL after we call journal_destroy(). This
will be later needed because after journal_destroy() is called,
ext4_clear_inode() can still be called for some inodes (e.g. root
inode) and we'll need to detect there that journal doesn't exists
anymore.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
---
 fs/ext4/super.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index c4b9faf..e239af3 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -506,6 +506,7 @@ static void ext4_put_super (struct super_block * sb)
 	ext4_ext_release(sb);
 	ext4_xattr_put_super(sb);
 	jbd2_journal_destroy(sbi->s_journal);
+	sbi->s_journal = NULL;
 	if (!(sb->s_flags & MS_RDONLY)) {
 		EXT4_CLEAR_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER);
 		es->s_state = cpu_to_le16(sbi->s_mount_state);
@@ -2423,6 +2424,7 @@ cantfind_ext4:
 
 failed_mount4:
 	jbd2_journal_destroy(sbi->s_journal);
+	sbi->s_journal = NULL;
 failed_mount3:
 	percpu_counter_destroy(&sbi->s_freeblocks_counter);
 	percpu_counter_destroy(&sbi->s_freeinodes_counter);
-- 
1.5.6.rc3.1.g36b7.dirty

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 28/52] ext4: Set journal pointer to NULL when journal..., Theodore Ts'o, (Sat Jul 5, 1:35 pm)
[PATCH 31/52] ext4: fix online resize with mballoc, Theodore Ts'o, (Sat Jul 5, 1:35 pm)
[PATCH 32/52] ext4: Documentation updates., Theodore Ts'o, (Sat Jul 5, 1:35 pm)
[PATCH 37/52] vfs: export filemap_fdatawrite_range(), Theodore Ts'o, (Sat Jul 5, 1:36 pm)
[PATCH 41/52] vfs: add basic delayed allocation support, Theodore Ts'o, (Sat Jul 5, 1:36 pm)
[PATCH 44/52] ext4: delayed allocation ENOSPC handling, Theodore Ts'o, (Sat Jul 5, 1:36 pm)
[PATCH 45/52] mm: Add range_cont mode for writeback, Theodore Ts'o, (Sat Jul 5, 1:36 pm)
[PATCH 50/52] ext4: Enable delalloc by default., Theodore Ts'o, (Sat Jul 5, 1:36 pm)