All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ext4: don't save the error information if the block device is read-only
@ 2015-05-14 22:37 Theodore Ts'o
       [not found] ` <CAG_9a6cSd-1VDD8zkCt7zFPbBi01a78VeOTDyi0NJuvS26XApw@mail.gmail.com>
  0 siblings, 1 reply; 2+ messages in thread
From: Theodore Ts'o @ 2015-05-14 22:37 UTC (permalink / raw)
  To: Ext4 Developers List; +Cc: mkayyash, Theodore Ts'o

Google-Bug-Id: 20939131
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
---
 fs/ext4/super.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index f06d058..ca9d4a2 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -294,6 +294,8 @@ static void __save_error_info(struct super_block *sb, const char *func,
 	struct ext4_super_block *es = EXT4_SB(sb)->s_es;
 
 	EXT4_SB(sb)->s_mount_state |= EXT4_ERROR_FS;
+	if (bdev_read_only(sb->s_bdev))
+		return;
 	es->s_state |= cpu_to_le16(EXT4_ERROR_FS);
 	es->s_last_error_time = cpu_to_le32(get_seconds());
 	strncpy(es->s_last_error_func, func, sizeof(es->s_last_error_func));
-- 
2.3.0


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

* Re: [PATCH] ext4: don't save the error information if the block device is read-only
       [not found] ` <CAG_9a6cSd-1VDD8zkCt7zFPbBi01a78VeOTDyi0NJuvS26XApw@mail.gmail.com>
@ 2015-05-15 23:36   ` Theodore Ts'o
  0 siblings, 0 replies; 2+ messages in thread
From: Theodore Ts'o @ 2015-05-15 23:36 UTC (permalink / raw)
  To: Mohamad Ayyash; +Cc: Ext4 Developers List

On Fri, May 15, 2015 at 09:34:18PM +0000, Mohamad Ayyash wrote:
> I wonder if there should be some similar protection at other callers of
> ext4_commit_super like ext4_mark_recovery_complete?

We do have protections already before we start replaying the journal,
and before we process the orphaned inode list.  See the
bdev_read_only() calls in ext4_orphan_cleanup() and ext4_load_journal().

So I think we have them all covered, but let me know if you find one
that we've missed.  Something that's probably worth doing is to
putting in a debugging patch that notices when thre are writes sent
down from the file systems when the block device is marked read-only,
and then running xfstests and seeing if it trips anywhere.

Cheers,

						- Ted

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

end of thread, other threads:[~2015-05-15 23:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-14 22:37 [PATCH] ext4: don't save the error information if the block device is read-only Theodore Ts'o
     [not found] ` <CAG_9a6cSd-1VDD8zkCt7zFPbBi01a78VeOTDyi0NJuvS26XApw@mail.gmail.com>
2015-05-15 23:36   ` Theodore Ts'o

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.