diff options
| author | Theodore Ts'o <tytso@mit.edu> | 2015-05-14 18:37:30 -0400 |
|---|---|---|
| committer | Mister Oyster <oysterized@gmail.com> | 2017-04-16 17:12:08 +0200 |
| commit | e2cb46123b23210179fbbb0ba2ab1635fb021900 (patch) | |
| tree | b24cd73b2053237c37066456c966876f543c5eec /fs | |
| parent | f1a502dad02cc4d86ff42eebb6495b441e9f5c40 (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>
Diffstat (limited to 'fs')
| -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 d500ee7f5..bca619f0f 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)); |
