mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: [PATCH 4.19 07/29] ext4: dont remount read-only with errors=continue on reboot
       [not found] ` <BYAPR02MB4759ADB966DDEAAE42B11EAA88AF0@BYAPR02MB4759.namprd02.prod.outlook.com>
@ 2021-01-07 12:15   ` greg
  0 siblings, 0 replies; 2+ messages in thread
From: greg @ 2021-01-07 12:15 UTC (permalink / raw)
  To: Partha Nayak; +Cc: linux-kernel

On Thu, Jan 07, 2021 at 11:39:14AM +0000, Partha Nayak wrote:
> Hi Greg / Linux community
> 
> I was going through the patch details: https://www.spinics.net/lists/stable/msg436529.html .
> 
> In our case the superblock for EXT4 is configured to trigger a kernel panic . But inspite of that the file system was mounted as read-only . We are on 4.19.12 .

4.19.12 is _VERY_ old and obsolete and totally insecure and is not
supported by the community, it was released over two years ago.

Why not apply the patch you link here and see if it solves your issue?

Or, better yet, move to 4.19.165, or 5.10.y?  What prevents you from
doing that?

good luck!

greg k-h

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 4.19 07/29] ext4: dont remount read-only with errors=continue on reboot
  2021-01-05  9:28 [PATCH 4.19 00/29] 4.19.165-rc2 review Greg Kroah-Hartman
@ 2021-01-05  9:28 ` Greg Kroah-Hartman
  0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2021-01-05  9:28 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Jan Kara, Andreas Dilger, stable,
	Theodore Tso, Sasha Levin

From: Jan Kara <jack@suse.cz>

[ Upstream commit b08070eca9e247f60ab39d79b2c25d274750441f ]

ext4_handle_error() with errors=continue mount option can accidentally
remount the filesystem read-only when the system is rebooting. Fix that.

Fixes: 1dc1097ff60e ("ext4: avoid panic during forced reboot")
Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Cc: stable@kernel.org
Link: https://lore.kernel.org/r/20201127113405.26867-2-jack@suse.cz
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 fs/ext4/super.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index ee96f504ed782..e9e9f09f5370d 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -454,19 +454,17 @@ static bool system_going_down(void)
 
 static void ext4_handle_error(struct super_block *sb)
 {
+	journal_t *journal = EXT4_SB(sb)->s_journal;
+
 	if (test_opt(sb, WARN_ON_ERROR))
 		WARN_ON_ONCE(1);
 
-	if (sb_rdonly(sb))
+	if (sb_rdonly(sb) || test_opt(sb, ERRORS_CONT))
 		return;
 
-	if (!test_opt(sb, ERRORS_CONT)) {
-		journal_t *journal = EXT4_SB(sb)->s_journal;
-
-		EXT4_SB(sb)->s_mount_flags |= EXT4_MF_FS_ABORTED;
-		if (journal)
-			jbd2_journal_abort(journal, -EIO);
-	}
+	EXT4_SB(sb)->s_mount_flags |= EXT4_MF_FS_ABORTED;
+	if (journal)
+		jbd2_journal_abort(journal, -EIO);
 	/*
 	 * We force ERRORS_RO behavior when system is rebooting. Otherwise we
 	 * could panic during 'reboot -f' as the underlying device got already
-- 
2.27.0




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-01-07 12:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <BYAPR02MB4759194730E06BCDC10892AC88AF0@BYAPR02MB4759.namprd02.prod.outlook.com>
     [not found] ` <BYAPR02MB4759ADB966DDEAAE42B11EAA88AF0@BYAPR02MB4759.namprd02.prod.outlook.com>
2021-01-07 12:15   ` [PATCH 4.19 07/29] ext4: dont remount read-only with errors=continue on reboot greg
2021-01-05  9:28 [PATCH 4.19 00/29] 4.19.165-rc2 review Greg Kroah-Hartman
2021-01-05  9:28 ` [PATCH 4.19 07/29] ext4: dont remount read-only with errors=continue on reboot Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®