diff options
author | Theodore Ts'o <tytso@mit.edu> | 2015-05-14 18:37:30 -0400 |
---|---|---|
committer | Mohamad Ayyash <mkayyash@google.com> | 2015-05-22 17:17:31 -0700 |
commit | 0f89d153f92533960cef3ac32d0fd8cb857c07a0 (patch) | |
tree | 150a2bfa2ca8d9cd69909cdbfe424a2ea48ef6a9 | |
parent | 0374990a32aee718d74431a108559ae67fa217f5 (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.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 2c9e6864abd9..03e0b5c8ec14 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -304,6 +304,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)); |