The commit is pushed to "branch-rh10-6.12.0-55.13.1.2.x.vz10-ovz" and will 
appear at [email protected]:openvz/vzkernel.git
after rh10-6.12.0-55.13.1.2.23.vz10
------>
commit bfdcb9a5437d8470ba3c333db69566106977d696
Author: Jan Kara <[email protected]>
Date:   Wed Dec 3 15:48:21 2025 +0000

    ms/ext4: avoid remount errors with 'abort' mount option
    
    When we remount filesystem with 'abort' mount option while changing
    other mount options as well (as is LTP test doing), we can return error
    from the system call after commit d3476f3dad4a ("ext4: don't set
    SB_RDONLY after filesystem errors") because the application of mount
    option changes detects shutdown filesystem and refuses to do anything.
    The behavior of application of other mount options in presence of
    'abort' mount option is currently rather arbitary as some mount option
    changes are handled before 'abort' and some after it.
    
    Move aborting of the filesystem to the end of remount handling so all
    requested changes are properly applied before the filesystem is shutdown
    to have a reasonably consistent behavior.
    
    Fixes: d3476f3dad4a ("ext4: don't set SB_RDONLY after filesystem errors")
    Reported-by: Jan Stancek <[email protected]>
    Link: https://lore.kernel.org/all/Zvp6L+oFnfASaoHl@t14s
    Signed-off-by: Jan Kara <[email protected]>
    Tested-by: Jan Stancek <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Theodore Ts'o <[email protected]>
    
    https://virtuozzo.atlassian.net/browse/VSTOR-120065
    (cherry picked from commit 76486b104168ae59703190566e372badf433314b)
    
    Signed-off-by: Vasileios Almpanis <[email protected]>
    
    Feature: ext4 fixes
---
 fs/ext4/super.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 6cc6c408cf94a..a810dcaa135c4 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -6635,9 +6635,6 @@ static int __ext4_remount(struct fs_context *fc, struct 
super_block *sb)
                goto restore_opts;
        }
 
-       if (test_opt2(sb, ABORT))
-               ext4_abort(sb, ESHUTDOWN, "Abort forced by user");
-
        sb->s_flags = (sb->s_flags & ~SB_POSIXACL) |
                (test_opt(sb, POSIX_ACL) ? SB_POSIXACL : 0);
 
@@ -6809,6 +6806,14 @@ static int __ext4_remount(struct fs_context *fc, struct 
super_block *sb)
        if (!ext4_has_feature_mmp(sb) || sb_rdonly(sb))
                ext4_stop_mmpd(sbi);
 
+       /*
+        * Handle aborting the filesystem as the last thing during remount to
+        * avoid obsure errors during remount when some option changes fail to
+        * apply due to shutdown filesystem.
+        */
+       if (test_opt2(sb, ABORT))
+               ext4_abort(sb, ESHUTDOWN, "Abort forced by user");
+
        return 0;
 
 restore_opts:
_______________________________________________
Devel mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to