aboutsummaryrefslogtreecommitdiff
path: root/fs
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-22 16:57:52 -0700
commitce422f730ad33b776b0c13c9d859691882e221b7 (patch)
tree8e1dfd96d9bb9a1d2269bd86d8732faf4f7640b6 /fs
parent1e483643a1a60a1578701437acfce5849f9373a8 (diff)
downloadlinux-linaro-stable-ce422f730ad33b776b0c13c9d859691882e221b7.tar.gz
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>
Diffstat (limited to 'fs')
-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 710fed2377d4..3540e6256d52 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -306,6 +306,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));