[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20231101042610.606136-1-bo.wu@vivo.com>
Date: Tue, 31 Oct 2023 22:26:10 -0600
From: Wu Bo <bo.wu@...o.com>
To: linux-kernel@...r.kernel.org
Cc: Alasdair Kergon <agk@...hat.com>,
Mike Snitzer <snitzer@...nel.org>, dm-devel@...ts.linux.dev,
Wu Bo <wubo.oduw@...il.com>, Wu Bo <bo.wu@...o.com>
Subject: [PATCH 1/1] dm verity: don't verity if readahead failed
If the IO is marked as readahead. When it is failed, it would better
to pass it to upper layer to handle it.
Consender the following situation:
dm-verity is built over a dm device.
'dm_submit_bio()' will return IO error when dm device is suspended.
And IO get nothing, but it will goto FEC, and trigger more IO on the
suspended device. It's a vicious circle.
Signed-off-by: Wu Bo <bo.wu@...o.com>
---
drivers/md/dm-verity-target.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/md/dm-verity-target.c b/drivers/md/dm-verity-target.c
index 26adcfea0302..253e65b4160e 100644
--- a/drivers/md/dm-verity-target.c
+++ b/drivers/md/dm-verity-target.c
@@ -667,7 +667,9 @@ static void verity_end_io(struct bio *bio)
struct dm_verity_io *io = bio->bi_private;
if (bio->bi_status &&
- (!verity_fec_is_enabled(io->v) || verity_is_system_shutting_down())) {
+ (!verity_fec_is_enabled(io->v) ||
+ verity_is_system_shutting_down() ||
+ (bio->bi_opf & REQ_RAHEAD))) {
verity_finish_io(io, bio->bi_status);
return;
}
--
2.25.1
Powered by blists - more mailing lists