+++ /dev/null
-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
-
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
+++ /dev/null
-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
-
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
+++ /dev/null
-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
-
--- 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);
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.
*/
--- 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);
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
+++ /dev/null
-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
-
--- 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);
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.
*/
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
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;
}
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;
}
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
}
}
}
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;
err = ext4_handle_clustersize(sb);
if (err)
---
-2.43.0
-
--- 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);
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
+++ /dev/null
-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
-
--- 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);
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