dm verity: skip verity work if I/O error when system is shutting down
authorHyeongseok Kim <hyeongseok@gmail.com>
Thu, 3 Dec 2020 00:46:59 +0000 (09:46 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Jan 2021 13:56:56 +0000 (14:56 +0100)
commitaff18aa806fd145e620ab9ae264caf3ec270e121
treee0d1122ca7ba9e6a4d10fd6df61605842e893df9
parent610d2fa0ec76ad17e9ddf3f5b53a9f6df1a7e18e
dm verity: skip verity work if I/O error when system is shutting down

[ Upstream commit 252bd1256396cebc6fc3526127fdb0b317601318 ]

If emergency system shutdown is called, like by thermal shutdown,
a dm device could be alive when the block device couldn't process
I/O requests anymore. In this state, the handling of I/O errors
by new dm I/O requests or by those already in-flight can lead to
a verity corruption state, which is a misjudgment.

So, skip verity work in response to I/O error when system is shutting
down.

Signed-off-by: Hyeongseok Kim <hyeongseok@gmail.com>
Reviewed-by: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/md/dm-verity-target.c