]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
drop offending ext4 patch from all branches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Oct 2024 09:38:26 +0000 (11:38 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Oct 2024 09:38:26 +0000 (11:38 +0200)
16 files changed:
queue-5.15/ext4-don-t-set-sb_rdonly-after-filesystem-errors.patch [deleted file]
queue-5.15/series
queue-6.1/ext4-don-t-set-sb_rdonly-after-filesystem-errors.patch [deleted file]
queue-6.1/series
queue-6.10/ext4-don-t-set-sb_rdonly-after-filesystem-errors.patch [deleted file]
queue-6.10/ext4-fix-access-to-uninitialised-lock-in-fc-replay-path.patch
queue-6.10/ext4-fix-timer-use-after-free-on-failed-mount.patch
queue-6.10/series
queue-6.11/ext4-don-t-set-sb_rdonly-after-filesystem-errors.patch [deleted file]
queue-6.11/ext4-fix-access-to-uninitialised-lock-in-fc-replay-path.patch
queue-6.11/ext4-fix-error-message-when-rejecting-the-default-ha.patch
queue-6.11/ext4-fix-timer-use-after-free-on-failed-mount.patch
queue-6.11/series
queue-6.6/ext4-don-t-set-sb_rdonly-after-filesystem-errors.patch [deleted file]
queue-6.6/ext4-fix-timer-use-after-free-on-failed-mount.patch
queue-6.6/series

diff --git a/queue-5.15/ext4-don-t-set-sb_rdonly-after-filesystem-errors.patch b/queue-5.15/ext4-don-t-set-sb_rdonly-after-filesystem-errors.patch
deleted file mode 100644 (file)
index 63f4cdb..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-From e646f8d16514828ccde2645053b61c709761bca5 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Mon, 5 Aug 2024 22:12:41 +0200
-Subject: ext4: don't set SB_RDONLY after filesystem errors
-
-From: Jan Kara <jack@suse.cz>
-
-[ Upstream commit d3476f3dad4ad68ae5f6b008ea6591d1520da5d8 ]
-
-When the filesystem is mounted with errors=remount-ro, we were setting
-SB_RDONLY flag to stop all filesystem modifications. We knew this misses
-proper locking (sb->s_umount) and does not go through proper filesystem
-remount procedure but it has been the way this worked since early ext2
-days and it was good enough for catastrophic situation damage
-mitigation. Recently, syzbot has found a way (see link) to trigger
-warnings in filesystem freezing because the code got confused by
-SB_RDONLY changing under its hands. Since these days we set
-EXT4_FLAGS_SHUTDOWN on the superblock which is enough to stop all
-filesystem modifications, modifying SB_RDONLY shouldn't be needed. So
-stop doing that.
-
-Link: https://lore.kernel.org/all/000000000000b90a8e061e21d12f@google.com
-Reported-by: Christian Brauner <brauner@kernel.org>
-Signed-off-by: Jan Kara <jack@suse.cz>
-Reviewed-by: Christian Brauner <brauner@kernel.org>
-Link: https://patch.msgid.link/20240805201241.27286-1-jack@suse.cz
-Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- fs/ext4/super.c | 9 +++++----
- 1 file changed, 5 insertions(+), 4 deletions(-)
-
-diff --git a/fs/ext4/super.c b/fs/ext4/super.c
-index b09b7a6b7a154..93eb26c162422 100644
---- a/fs/ext4/super.c
-+++ b/fs/ext4/super.c
-@@ -674,11 +674,12 @@ static void ext4_handle_error(struct super_block *sb, bool force_ro, int error,
-       ext4_msg(sb, KERN_CRIT, "Remounting filesystem read-only");
-       /*
--       * Make sure updated value of ->s_mount_flags will be visible before
--       * ->s_flags update
-+       * EXT4_FLAGS_SHUTDOWN was set which stops all filesystem
-+       * modifications. We don't set SB_RDONLY because that requires
-+       * sb->s_umount semaphore and setting it without proper remount
-+       * procedure is confusing code such as freeze_super() leading to
-+       * deadlocks and other problems.
-        */
--      smp_wmb();
--      sb->s_flags |= SB_RDONLY;
- }
- static void flush_stashed_error_work(struct work_struct *work)
--- 
-2.43.0
-
index c99729724d6930d43bc9dcb8fefb882cc48fec7b..7b1b4ff1073a5d18e5f6add4a57d76c3bed46cfa 100644 (file)
@@ -470,7 +470,6 @@ scsi-aacraid-rearrange-order-of-struct-aac_srb_unit.patch
 drm-radeon-r100-handle-unknown-family-in-r100_cp_ini.patch
 drm-amd-pm-ensure-the-fw_info-is-not-null-before-usi.patch
 of-irq-refer-to-actual-buffer-size-in-of_irq_parse_o.patch
-ext4-don-t-set-sb_rdonly-after-filesystem-errors.patch
 ext4-ext4_search_dir-should-return-a-proper-error.patch
 ext4-avoid-use-after-free-in-ext4_ext_show_leaf.patch
 ext4-fix-i_data_sem-unlock-order-in-ext4_ind_migrate.patch
diff --git a/queue-6.1/ext4-don-t-set-sb_rdonly-after-filesystem-errors.patch b/queue-6.1/ext4-don-t-set-sb_rdonly-after-filesystem-errors.patch
deleted file mode 100644 (file)
index 4caae33..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-From 43b28460c0dcbff4d2f0c469e57f599febebbf1f Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Mon, 5 Aug 2024 22:12:41 +0200
-Subject: ext4: don't set SB_RDONLY after filesystem errors
-
-From: Jan Kara <jack@suse.cz>
-
-[ Upstream commit d3476f3dad4ad68ae5f6b008ea6591d1520da5d8 ]
-
-When the filesystem is mounted with errors=remount-ro, we were setting
-SB_RDONLY flag to stop all filesystem modifications. We knew this misses
-proper locking (sb->s_umount) and does not go through proper filesystem
-remount procedure but it has been the way this worked since early ext2
-days and it was good enough for catastrophic situation damage
-mitigation. Recently, syzbot has found a way (see link) to trigger
-warnings in filesystem freezing because the code got confused by
-SB_RDONLY changing under its hands. Since these days we set
-EXT4_FLAGS_SHUTDOWN on the superblock which is enough to stop all
-filesystem modifications, modifying SB_RDONLY shouldn't be needed. So
-stop doing that.
-
-Link: https://lore.kernel.org/all/000000000000b90a8e061e21d12f@google.com
-Reported-by: Christian Brauner <brauner@kernel.org>
-Signed-off-by: Jan Kara <jack@suse.cz>
-Reviewed-by: Christian Brauner <brauner@kernel.org>
-Link: https://patch.msgid.link/20240805201241.27286-1-jack@suse.cz
-Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- fs/ext4/super.c | 9 +++++----
- 1 file changed, 5 insertions(+), 4 deletions(-)
-
-diff --git a/fs/ext4/super.c b/fs/ext4/super.c
-index 3db39758486e9..3bf214d4afef5 100644
---- a/fs/ext4/super.c
-+++ b/fs/ext4/super.c
-@@ -692,11 +692,12 @@ static void ext4_handle_error(struct super_block *sb, bool force_ro, int error,
-       ext4_msg(sb, KERN_CRIT, "Remounting filesystem read-only");
-       /*
--       * Make sure updated value of ->s_mount_flags will be visible before
--       * ->s_flags update
-+       * EXT4_FLAGS_SHUTDOWN was set which stops all filesystem
-+       * modifications. We don't set SB_RDONLY because that requires
-+       * sb->s_umount semaphore and setting it without proper remount
-+       * procedure is confusing code such as freeze_super() leading to
-+       * deadlocks and other problems.
-        */
--      smp_wmb();
--      sb->s_flags |= SB_RDONLY;
- }
- static void flush_stashed_error_work(struct work_struct *work)
--- 
-2.43.0
-
index 7e1f15a017ce10e8ffd5f2b27806a3bba8699aa2..567552dbe2f134d1db0e4917c6ca6a12094da216 100644 (file)
@@ -503,7 +503,6 @@ drm-radeon-r100-handle-unknown-family-in-r100_cp_ini.patch
 drm-amd-pm-ensure-the-fw_info-is-not-null-before-usi.patch
 of-irq-refer-to-actual-buffer-size-in-of_irq_parse_o.patch
 powerpc-pseries-use-correct-data-types-from-pseries_.patch
-ext4-don-t-set-sb_rdonly-after-filesystem-errors.patch
 ext4-ext4_search_dir-should-return-a-proper-error.patch
 ext4-avoid-use-after-free-in-ext4_ext_show_leaf.patch
 ext4-fix-i_data_sem-unlock-order-in-ext4_ind_migrate.patch
diff --git a/queue-6.10/ext4-don-t-set-sb_rdonly-after-filesystem-errors.patch b/queue-6.10/ext4-don-t-set-sb_rdonly-after-filesystem-errors.patch
deleted file mode 100644 (file)
index 4a655fb..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-From 4fa00095d061d1115320ef696fdbfae86d5a88f1 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Mon, 5 Aug 2024 22:12:41 +0200
-Subject: ext4: don't set SB_RDONLY after filesystem errors
-
-From: Jan Kara <jack@suse.cz>
-
-[ Upstream commit d3476f3dad4ad68ae5f6b008ea6591d1520da5d8 ]
-
-When the filesystem is mounted with errors=remount-ro, we were setting
-SB_RDONLY flag to stop all filesystem modifications. We knew this misses
-proper locking (sb->s_umount) and does not go through proper filesystem
-remount procedure but it has been the way this worked since early ext2
-days and it was good enough for catastrophic situation damage
-mitigation. Recently, syzbot has found a way (see link) to trigger
-warnings in filesystem freezing because the code got confused by
-SB_RDONLY changing under its hands. Since these days we set
-EXT4_FLAGS_SHUTDOWN on the superblock which is enough to stop all
-filesystem modifications, modifying SB_RDONLY shouldn't be needed. So
-stop doing that.
-
-Link: https://lore.kernel.org/all/000000000000b90a8e061e21d12f@google.com
-Reported-by: Christian Brauner <brauner@kernel.org>
-Signed-off-by: Jan Kara <jack@suse.cz>
-Reviewed-by: Christian Brauner <brauner@kernel.org>
-Link: https://patch.msgid.link/20240805201241.27286-1-jack@suse.cz
-Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- fs/ext4/super.c | 9 +++++----
- 1 file changed, 5 insertions(+), 4 deletions(-)
-
-diff --git a/fs/ext4/super.c b/fs/ext4/super.c
-index edc692984404d..04b78c479fd7a 100644
---- a/fs/ext4/super.c
-+++ b/fs/ext4/super.c
-@@ -735,11 +735,12 @@ static void ext4_handle_error(struct super_block *sb, bool force_ro, int error,
-       ext4_msg(sb, KERN_CRIT, "Remounting filesystem read-only");
-       /*
--       * Make sure updated value of ->s_mount_flags will be visible before
--       * ->s_flags update
-+       * EXT4_FLAGS_SHUTDOWN was set which stops all filesystem
-+       * modifications. We don't set SB_RDONLY because that requires
-+       * sb->s_umount semaphore and setting it without proper remount
-+       * procedure is confusing code such as freeze_super() leading to
-+       * deadlocks and other problems.
-        */
--      smp_wmb();
--      sb->s_flags |= SB_RDONLY;
- }
- static void update_super_work(struct work_struct *work)
--- 
-2.43.0
-
index 2773146167a46c632f7f789e112db49023a20111..331aea0a56243a38a96e564bd67aed6c2c455531 100644 (file)
@@ -57,7 +57,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 
 --- a/fs/ext4/super.c
 +++ b/fs/ext4/super.c
-@@ -5332,6 +5332,8 @@ static int __ext4_fill_super(struct fs_c
+@@ -5331,6 +5331,8 @@ static int __ext4_fill_super(struct fs_c
        INIT_LIST_HEAD(&sbi->s_orphan); /* unlinked but open files */
        mutex_init(&sbi->s_orphan_lock);
  
@@ -66,7 +66,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
        ext4_fast_commit_init(sb);
  
        sb->s_root = NULL;
-@@ -5553,7 +5555,6 @@ static int __ext4_fill_super(struct fs_c
+@@ -5552,7 +5554,6 @@ static int __ext4_fill_super(struct fs_c
         * Save the original bdev mapping's wb_err value which could be
         * used to detect the metadata async write error.
         */
index fbcfa4cc05953a345fb1fe551007125d11b81e7d..0da345d74be11bdbd54e5ef3855fb516b7c22084 100644 (file)
@@ -34,7 +34,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 
 --- a/fs/ext4/super.c
 +++ b/fs/ext4/super.c
-@@ -5633,8 +5633,8 @@ failed_mount3a:
+@@ -5632,8 +5632,8 @@ failed_mount3a:
  failed_mount3:
        /* flush s_sb_upd_work before sbi destroy */
        flush_work(&sbi->s_sb_upd_work);
index 80930153fb14a324e567a7aea74295ad6d85d7c3..c6436817da28adff86c280e77f0ca113a8d0f081 100644 (file)
@@ -244,7 +244,6 @@ hid-i2c-hid-ensure-various-commands-do-not-interfere.patch
 ksmbd-add-refcnt-to-ksmbd_conn-struct.patch
 platform-mellanox-mlxbf-pmc-fix-lockdep-warning.patch
 platform-x86-x86-android-tablets-adjust-xiaomi-pad-2.patch
-ext4-don-t-set-sb_rdonly-after-filesystem-errors.patch
 bpf-make-the-pointer-returned-by-iter-next-method-va.patch
 ext4-ext4_search_dir-should-return-a-proper-error.patch
 ext4-avoid-use-after-free-in-ext4_ext_show_leaf.patch
diff --git a/queue-6.11/ext4-don-t-set-sb_rdonly-after-filesystem-errors.patch b/queue-6.11/ext4-don-t-set-sb_rdonly-after-filesystem-errors.patch
deleted file mode 100644 (file)
index 7b9da5f..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-From 822e36f1bec439e66e5a268cf5f05536cd783021 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Mon, 5 Aug 2024 22:12:41 +0200
-Subject: ext4: don't set SB_RDONLY after filesystem errors
-
-From: Jan Kara <jack@suse.cz>
-
-[ Upstream commit d3476f3dad4ad68ae5f6b008ea6591d1520da5d8 ]
-
-When the filesystem is mounted with errors=remount-ro, we were setting
-SB_RDONLY flag to stop all filesystem modifications. We knew this misses
-proper locking (sb->s_umount) and does not go through proper filesystem
-remount procedure but it has been the way this worked since early ext2
-days and it was good enough for catastrophic situation damage
-mitigation. Recently, syzbot has found a way (see link) to trigger
-warnings in filesystem freezing because the code got confused by
-SB_RDONLY changing under its hands. Since these days we set
-EXT4_FLAGS_SHUTDOWN on the superblock which is enough to stop all
-filesystem modifications, modifying SB_RDONLY shouldn't be needed. So
-stop doing that.
-
-Link: https://lore.kernel.org/all/000000000000b90a8e061e21d12f@google.com
-Reported-by: Christian Brauner <brauner@kernel.org>
-Signed-off-by: Jan Kara <jack@suse.cz>
-Reviewed-by: Christian Brauner <brauner@kernel.org>
-Link: https://patch.msgid.link/20240805201241.27286-1-jack@suse.cz
-Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- fs/ext4/super.c | 9 +++++----
- 1 file changed, 5 insertions(+), 4 deletions(-)
-
-diff --git a/fs/ext4/super.c b/fs/ext4/super.c
-index cecea19908109..b3f47d6879ebf 100644
---- a/fs/ext4/super.c
-+++ b/fs/ext4/super.c
-@@ -735,11 +735,12 @@ static void ext4_handle_error(struct super_block *sb, bool force_ro, int error,
-       ext4_msg(sb, KERN_CRIT, "Remounting filesystem read-only");
-       /*
--       * Make sure updated value of ->s_mount_flags will be visible before
--       * ->s_flags update
-+       * EXT4_FLAGS_SHUTDOWN was set which stops all filesystem
-+       * modifications. We don't set SB_RDONLY because that requires
-+       * sb->s_umount semaphore and setting it without proper remount
-+       * procedure is confusing code such as freeze_super() leading to
-+       * deadlocks and other problems.
-        */
--      smp_wmb();
--      sb->s_flags |= SB_RDONLY;
- }
- static void update_super_work(struct work_struct *work)
--- 
-2.43.0
-
index 7ed5532882c8f0b52fbce54cda01886daffeaa78..1492944ab79db7c54da7f22396e283e39bff1882 100644 (file)
@@ -57,7 +57,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 
 --- a/fs/ext4/super.c
 +++ b/fs/ext4/super.c
-@@ -5334,6 +5334,8 @@ static int __ext4_fill_super(struct fs_c
+@@ -5333,6 +5333,8 @@ static int __ext4_fill_super(struct fs_c
        INIT_LIST_HEAD(&sbi->s_orphan); /* unlinked but open files */
        mutex_init(&sbi->s_orphan_lock);
  
@@ -66,7 +66,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
        ext4_fast_commit_init(sb);
  
        sb->s_root = NULL;
-@@ -5555,7 +5557,6 @@ static int __ext4_fill_super(struct fs_c
+@@ -5554,7 +5556,6 @@ static int __ext4_fill_super(struct fs_c
         * Save the original bdev mapping's wb_err value which could be
         * used to detect the metadata async write error.
         */
index aafb648fc37ce1eb439fd2c1173d9a68cf55abad..3e4b7ffdf569ea9d61c09529fec2e864d2413484 100644 (file)
@@ -22,15 +22,13 @@ Link: https://patch.msgid.link/87jzg1en6j.fsf_-_@mailhost.krisman.be
 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
 Signed-off-by: Sasha Levin <sashal@kernel.org>
 ---
- fs/ext4/ext4.h  |  1 +
- fs/ext4/super.c | 27 +++++++++++++++++----------
+ fs/ext4/ext4.h  |    1 +
+ fs/ext4/super.c |   27 +++++++++++++++++----------
  2 files changed, 18 insertions(+), 10 deletions(-)
 
-diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
-index 08acd152261ed..8bd302392d759 100644
 --- a/fs/ext4/ext4.h
 +++ b/fs/ext4/ext4.h
-@@ -2462,6 +2462,7 @@ static inline __le16 ext4_rec_len_to_disk(unsigned len, unsigned blocksize)
+@@ -2462,6 +2462,7 @@ static inline __le16 ext4_rec_len_to_dis
  #define DX_HASH_HALF_MD4_UNSIGNED     4
  #define DX_HASH_TEA_UNSIGNED          5
  #define DX_HASH_SIPHASH                       6
@@ -38,11 +36,9 @@ index 08acd152261ed..8bd302392d759 100644
  
  static inline u32 ext4_chksum(struct ext4_sb_info *sbi, u32 crc,
                              const void *address, unsigned int length)
-diff --git a/fs/ext4/super.c b/fs/ext4/super.c
-index b3f47d6879ebf..1cd4e20cc320d 100644
 --- a/fs/ext4/super.c
 +++ b/fs/ext4/super.c
-@@ -3583,13 +3583,6 @@ int ext4_feature_set_ok(struct super_block *sb, int readonly)
+@@ -3582,13 +3582,6 @@ int ext4_feature_set_ok(struct super_blo
                         "mounted without CONFIG_UNICODE");
                return 0;
        }
@@ -56,7 +52,7 @@ index b3f47d6879ebf..1cd4e20cc320d 100644
  
        if (readonly)
                return 1;
-@@ -5095,16 +5088,27 @@ static int ext4_load_super(struct super_block *sb, ext4_fsblk_t *lsb,
+@@ -5094,16 +5087,27 @@ out:
        return ret;
  }
  
@@ -86,7 +82,7 @@ index b3f47d6879ebf..1cd4e20cc320d 100644
        if (ext4_has_feature_dir_index(sb)) {
                i = le32_to_cpu(es->s_flags);
                if (i & EXT2_FLAGS_UNSIGNED_HASH)
-@@ -5122,6 +5126,7 @@ static void ext4_hash_info_init(struct super_block *sb)
+@@ -5121,6 +5125,7 @@ static void ext4_hash_info_init(struct s
  #endif
                }
        }
@@ -94,7 +90,7 @@ index b3f47d6879ebf..1cd4e20cc320d 100644
  }
  
  static int ext4_block_group_meta_init(struct super_block *sb, int silent)
-@@ -5269,7 +5274,9 @@ static int __ext4_fill_super(struct fs_context *fc, struct super_block *sb)
+@@ -5268,7 +5273,9 @@ static int __ext4_fill_super(struct fs_c
        if (err)
                goto failed_mount;
  
@@ -105,6 +101,3 @@ index b3f47d6879ebf..1cd4e20cc320d 100644
  
        err = ext4_handle_clustersize(sb);
        if (err)
--- 
-2.43.0
-
index 8798367a4b1bfceb629c27272c861b4a1f971c3f..ef96a6503c88dc1cc1e9bee9ad6775f28f5122a2 100644 (file)
@@ -34,7 +34,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 
 --- a/fs/ext4/super.c
 +++ b/fs/ext4/super.c
-@@ -5635,8 +5635,8 @@ failed_mount3a:
+@@ -5634,8 +5634,8 @@ failed_mount3a:
  failed_mount3:
        /* flush s_sb_upd_work before sbi destroy */
        flush_work(&sbi->s_sb_upd_work);
index 71a408ba528ac98bb19cffcff39c7f5881d3e787..6d3c1cd2c434ef3bc93e945f27b529596595698d 100644 (file)
@@ -300,7 +300,6 @@ ksmbd-add-refcnt-to-ksmbd_conn-struct.patch
 platform-mellanox-mlxbf-pmc-fix-lockdep-warning.patch
 platform-x86-x86-android-tablets-adjust-xiaomi-pad-2.patch
 ext4-filesystems-without-casefold-feature-cannot-be-.patch
-ext4-don-t-set-sb_rdonly-after-filesystem-errors.patch
 bpf-make-the-pointer-returned-by-iter-next-method-va.patch
 ext4-ext4_search_dir-should-return-a-proper-error.patch
 ext4-avoid-use-after-free-in-ext4_ext_show_leaf.patch
diff --git a/queue-6.6/ext4-don-t-set-sb_rdonly-after-filesystem-errors.patch b/queue-6.6/ext4-don-t-set-sb_rdonly-after-filesystem-errors.patch
deleted file mode 100644 (file)
index c6a5449..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-From 72f6c5e53e252ae7488abe45ab29488a4696002b Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Mon, 5 Aug 2024 22:12:41 +0200
-Subject: ext4: don't set SB_RDONLY after filesystem errors
-
-From: Jan Kara <jack@suse.cz>
-
-[ Upstream commit d3476f3dad4ad68ae5f6b008ea6591d1520da5d8 ]
-
-When the filesystem is mounted with errors=remount-ro, we were setting
-SB_RDONLY flag to stop all filesystem modifications. We knew this misses
-proper locking (sb->s_umount) and does not go through proper filesystem
-remount procedure but it has been the way this worked since early ext2
-days and it was good enough for catastrophic situation damage
-mitigation. Recently, syzbot has found a way (see link) to trigger
-warnings in filesystem freezing because the code got confused by
-SB_RDONLY changing under its hands. Since these days we set
-EXT4_FLAGS_SHUTDOWN on the superblock which is enough to stop all
-filesystem modifications, modifying SB_RDONLY shouldn't be needed. So
-stop doing that.
-
-Link: https://lore.kernel.org/all/000000000000b90a8e061e21d12f@google.com
-Reported-by: Christian Brauner <brauner@kernel.org>
-Signed-off-by: Jan Kara <jack@suse.cz>
-Reviewed-by: Christian Brauner <brauner@kernel.org>
-Link: https://patch.msgid.link/20240805201241.27286-1-jack@suse.cz
-Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- fs/ext4/super.c | 9 +++++----
- 1 file changed, 5 insertions(+), 4 deletions(-)
-
-diff --git a/fs/ext4/super.c b/fs/ext4/super.c
-index 46c4f75049791..53ead0650fc8a 100644
---- a/fs/ext4/super.c
-+++ b/fs/ext4/super.c
-@@ -744,11 +744,12 @@ static void ext4_handle_error(struct super_block *sb, bool force_ro, int error,
-       ext4_msg(sb, KERN_CRIT, "Remounting filesystem read-only");
-       /*
--       * Make sure updated value of ->s_mount_flags will be visible before
--       * ->s_flags update
-+       * EXT4_FLAGS_SHUTDOWN was set which stops all filesystem
-+       * modifications. We don't set SB_RDONLY because that requires
-+       * sb->s_umount semaphore and setting it without proper remount
-+       * procedure is confusing code such as freeze_super() leading to
-+       * deadlocks and other problems.
-        */
--      smp_wmb();
--      sb->s_flags |= SB_RDONLY;
- }
- static void update_super_work(struct work_struct *work)
--- 
-2.43.0
-
index 828db25ac76784d0bd48820f6d7a1259dbc05f33..b42d3699d8c9559865e2367514219c6778cb42de 100644 (file)
@@ -34,7 +34,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 
 --- a/fs/ext4/super.c
 +++ b/fs/ext4/super.c
-@@ -5659,8 +5659,8 @@ failed_mount3a:
+@@ -5658,8 +5658,8 @@ failed_mount3a:
  failed_mount3:
        /* flush s_sb_upd_work before sbi destroy */
        flush_work(&sbi->s_sb_upd_work);
index 543f3e1579f24657c8c8b76d8e11fb1ac0db70e5..de40d917aea9beba83602623b15dced4d435298b 100644 (file)
@@ -173,7 +173,6 @@ drm-amdgpu-gfx11-use-rlc-safe-mode-for-soft-recovery.patch
 drm-amdgpu-gfx10-use-rlc-safe-mode-for-soft-recovery.patch
 platform-x86-lenovo-ymc-ignore-the-0x0-state.patch
 ksmbd-add-refcnt-to-ksmbd_conn-struct.patch
-ext4-don-t-set-sb_rdonly-after-filesystem-errors.patch
 bpf-make-the-pointer-returned-by-iter-next-method-va.patch
 ext4-ext4_search_dir-should-return-a-proper-error.patch
 ext4-avoid-use-after-free-in-ext4_ext_show_leaf.patch