Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0f89d153 authored by Theodore Ts'o's avatar Theodore Ts'o Committed by Mohamad Ayyash
Browse files

ext4: don't save the error information if the block device is read-only



Google-Bug-Id: 20939131
Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
parent 0374990a
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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));