OSDN Git Service

ext4: avoid panic during forced reboot
authorJan Kara <jack@suse.cz>
Fri, 15 Mar 2019 03:46:05 +0000 (23:46 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 20 Apr 2019 07:15:54 +0000 (09:15 +0200)
commit90a1327e4ed3e2c840b86f1f35d5aec712c652c4
tree12750bb9f236bf6143d7dea5acfeff7c1920cb85
parent673e23ce80a60adc09e1dc68e957f7ae6c2b6603
ext4: avoid panic during forced reboot

[ Upstream commit 1dc1097ff60e4105216da7cd0aa99032b039a994 ]

When admin calls "reboot -f" - i.e., does a hard system reboot by
directly calling reboot(2) - ext4 filesystem mounted with errors=panic
can panic the system. This happens because the underlying device gets
disabled without unmounting the filesystem and thus some syscall running
in parallel to reboot(2) can result in the filesystem getting IO errors.

This is somewhat surprising to the users so try improve the behavior by
switching to errors=remount-ro behavior when the system is running
reboot(2).

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/ext4/super.c