[Devel] [PATCH RHEL7 COMMIT] ms/ext4: remove extent status procfs files if journal load fails

Konstantin Khorenko khorenko at virtuozzo.com
Thu Dec 26 14:48:16 MSK 2019


The commit is pushed to "branch-rh7-3.10.0-1062.7.1.vz7.130.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-1062.7.1.vz7.130.5
------>
commit 3629eed36790c691f388d668535902fac19ede22
Author: Darrick J. Wong <darrick.wong at oracle.com>
Date:   Fri Apr 27 13:55:11 2018 +0300

    ms/ext4: remove extent status procfs files if journal load fails
    
    commit 50460fe8c6d1d95b16427936e351f277a1c72d43 upstream.
    
    If we can't load the journal, remove the procfs files for the extent
    status information file to avoid leaking resources.
    
    Signed-off-by: Darrick J. Wong <darrick.wong at oracle.com>
    Signed-off-by: Theodore Ts'o <tytso at mit.edu>
    Cc: stable at vger.kernel.org
    
    [aryabinin: This bug causes the WARN bellow, eventually leading
      to crash in shrink_slab()]
    
    EXT4-fs (loop0): INFO: recovery required on readonly filesystem
    EXT4-fs (loop0): write access unavailable, cannot proceed
    Call Trace:
     [<ffffffff816d5d81>] dump_stack+0x19/0x1b
     [<ffffffff8108a8d8>] __warn+0xd8/0x100
     [<ffffffff8108a95f>] warn_slowpath_fmt+0x5f/0x80
     [<ffffffff81298c11>] remove_proc_entry+0x151/0x1a0
     [<ffffffffc03985e7>] ext4_fill_super+0x267/0x2cc0 [ext4]
     [<ffffffff81222c92>] mount_bdev+0x1f2/0x240
     [<ffffffffc0392ef4>] ext4_mount+0x44/0x60 [ext4]
     [<ffffffff81223849>] mount_fs+0x39/0x1b0
     [<ffffffff81240e87>] vfs_kern_mount+0x67/0x110
     [<ffffffff8124372c>] do_mount+0x24c/0xb30
     [<ffffffff81244356>] SyS_mount+0x96/0xf0
     [<ffffffff816e8a7d>] system_call_fastpath+0x16/0x1b
    ---[ end trace 8b5c76e01d611a1e ]---
    
    https://jira.sw.ru/browse/PSBM-83691
    Signed-off-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
---
 fs/ext4/super.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index c667b6fe2fb7d..7b77cabae690c 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -4506,7 +4506,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
 	if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_MMP) &&
 	    !(sb->s_flags & MS_RDONLY))
 		if (ext4_multi_mount_protect(sb, le64_to_cpu(es->s_mmp_block)))
-			goto failed_mount3;
+			goto failed_mount3a;
 
 	/*
 	 * The first inode we look at is the journal inode.  Don't try
@@ -4516,7 +4516,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
 	    EXT4_HAS_COMPAT_FEATURE(sb, EXT4_FEATURE_COMPAT_HAS_JOURNAL)) {
 		err = ext4_load_journal(sb, es, journal_devnum);
 		if (err)
-			goto failed_mount3;
+			goto failed_mount3a;
 	} else if (test_opt(sb, NOLOAD) && !(sb->s_flags & MS_RDONLY) &&
 	      EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER)) {
 		ext4_msg(sb, KERN_ERR, "required journal recovery "
@@ -4803,6 +4803,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
 		jbd2_journal_destroy(sbi->s_journal);
 		sbi->s_journal = NULL;
 	}
+failed_mount3a:
 	ext4_es_unregister_shrinker(sbi);
 failed_mount3:
 	del_timer_sync(&sbi->s_err_report);



More information about the Devel mailing list