Whamcloud - gitweb
LU-13300 ldiskfs: port patches to improve extent status shrink
[fs/lustre-release.git] / ldiskfs / kernel_patches / patches / rhel7.6 / ext4-remove-extent-status-procfs-files-if-journal-lo.patch
1 From fabafc86567c2165c5b2165dcbf835edd6f81e72 Mon Sep 17 00:00:00 2001
2 From: "Darrick J. Wong" <darrick.wong@oracle.com>
3 Date: Thu, 30 Oct 2014 10:53:16 -0400
4 Subject: [PATCH 2/7] ext4: remove extent status procfs files if journal load
5  fails
6
7 If we can't load the journal, remove the procfs files for the extent
8 status information file to avoid leaking resources.
9
10 Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
11 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
12 Cc: stable@vger.kernel.org
13 ---
14  fs/ext4/super.c | 5 +++--
15  1 file changed, 3 insertions(+), 2 deletions(-)
16
17 diff --git a/fs/ext4/super.c b/fs/ext4/super.c
18 index bcdb48cf..95a01d56 100644
19 --- a/fs/ext4/super.c
20 +++ b/fs/ext4/super.c
21 @@ -4326,7 +4326,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
22         if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_MMP) &&
23             !(sb->s_flags & MS_RDONLY))
24                 if (ext4_multi_mount_protect(sb, le64_to_cpu(es->s_mmp_block)))
25 -                       goto failed_mount3;
26 +                       goto failed_mount3a;
27  
28         ext4_ext_init(sb); /* needed before using extent-mapped journal */
29  
30 @@ -4338,7 +4338,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
31             EXT4_HAS_COMPAT_FEATURE(sb, EXT4_FEATURE_COMPAT_HAS_JOURNAL)) {
32                 err = ext4_load_journal(sb, es, journal_devnum);
33                 if (err)
34 -                       goto failed_mount3;
35 +                       goto failed_mount3a;
36         } else if (test_opt(sb, NOLOAD) && !(sb->s_flags & MS_RDONLY) &&
37               EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER)) {
38                 ext4_msg(sb, KERN_ERR, "required journal recovery "
39 @@ -4635,6 +4635,7 @@ failed_mount_wq:
40                 jbd2_journal_destroy(sbi->s_journal);
41                 sbi->s_journal = NULL;
42         }
43 +failed_mount3a:
44         ext4_es_unregister_shrinker(sbi);
45  failed_mount3:
46         del_timer_sync(&sbi->s_err_report);
47 -- 
48 2.24.1
49