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

Commit 2d27b92b authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "dm verity: skip verity work on I/O errors when system is shutting down"

parents 60146902 f1a09803
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -67,6 +67,14 @@ struct dm_verity_prefetch_work {
struct buffer_aux {
	int hash_verified;
};
/*
 * While system shutdown, skip verity work for I/O error.
 */
static inline bool verity_is_system_shutting_down(void)
{
	return system_state == SYSTEM_HALT || system_state == SYSTEM_POWER_OFF
		|| system_state == SYSTEM_RESTART;
}

/*
 * Initialize struct buffer_aux for a freshly created buffer.
@@ -513,7 +521,8 @@ static void verity_end_io(struct bio *bio)
{
	struct dm_verity_io *io = bio->bi_private;

	if (bio->bi_error && !verity_fec_is_enabled(io->v)) {
	if (bio->bi_error &&
		(!verity_fec_is_enabled(io->v) || verity_is_system_shutting_down())) {
		verity_finish_io(io, bio->bi_error);
		return;
	}