add patch prevent-bugon-on-race-between-write-fcntl
[ext4-patch-queue.git] / remove-extent-status-procfs-files-if-journal-load-fails
blob981deb3589d3c58321a00e39646bc09cbcccdbf8
1 ext4: remove extent status procfs files if journal load fails
3 From: "Darrick J. Wong" <darrick.wong@oracle.com>
5 If we can't load the journal, remove the procfs files for the extent
6 status information file to avoid leaking resources.
8 Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
9 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
10 Cc: stable@vger.kernel.org
11 ---
12  fs/ext4/super.c |    5 +++--
13  1 file changed, 3 insertions(+), 2 deletions(-)
16 diff --git a/fs/ext4/super.c b/fs/ext4/super.c
17 index 96059e0..2c9e686 100644
18 --- a/fs/ext4/super.c
19 +++ b/fs/ext4/super.c
20 @@ -3947,7 +3947,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
21         if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_MMP) &&
22             !(sb->s_flags & MS_RDONLY))
23                 if (ext4_multi_mount_protect(sb, le64_to_cpu(es->s_mmp_block)))
24 -                       goto failed_mount3;
25 +                       goto failed_mount3a;
27         /*
28          * The first inode we look at is the journal inode.  Don't try
29 @@ -3956,7 +3956,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
30         if (!test_opt(sb, NOLOAD) &&
31             EXT4_HAS_COMPAT_FEATURE(sb, EXT4_FEATURE_COMPAT_HAS_JOURNAL)) {
32                 if (ext4_load_journal(sb, es, journal_devnum))
33 -                       goto failed_mount3;
34 +                       goto failed_mount3a;
35         } else if (test_opt(sb, NOLOAD) && !(sb->s_flags & MS_RDONLY) &&
36               EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER)) {
37                 ext4_msg(sb, KERN_ERR, "required journal recovery "
38 @@ -4244,6 +4244,7 @@ failed_mount_wq:
39                 jbd2_journal_destroy(sbi->s_journal);
40                 sbi->s_journal = NULL;
41         }
42 +failed_mount3a:
43         ext4_es_unregister_shrinker(sbi);
44  failed_mount3:
45         del_timer_sync(&sbi->s_err_report);