aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2015-05-14 18:37:30 -0400
committerMohamad Ayyash <mkayyash@google.com>2015-05-20 19:19:58 -0700
commit00a6e4dfa128c20861fbcd8adf3f28a8bf3a673e (patch)
tree77445f2d1756afce0e8eee4c7fab7909c6841aff
parent6e9c6582376ac3c430bf7c89647313b2e685a597 (diff)
ext4: don't save the error information if the block device is read-only
Google-Bug-Id: 20939131 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-rw-r--r--fs/ext4/super.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 48c8af5fe91d..fece245c796f 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -305,6 +305,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));