dm-integrity: Do not check integrity for failed read operations
PATCH 1/1 dm-integrity: Do not check integrity for failed read operations
From: Hyunchul Lee <[email protected]>
Even though read operations fail, dm_integrity_map_continue() calls integrity_metadata() to check integrity. In this case, just complete these.
--- drivers/md/dm-integrity.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/md/dm-integrity.c +5 -1
@@ -1697,7 +1697,11 @@ static void dm_integrity_map_continue(struct dm_integrity_io *dio, bool from_mapif (need_sync_io) {wait_for_completion_io (&read_comp); -integrity_metadata (&dio->work); +if (likely (!bio->bi_status)) +integrity_metadata (&dio->work); +else +dec_in_flight (dio); + }else {INIT_WORK (&dio->work, integrity_metadata);queue_work (ic->metadata_wq, &dio->work);
Signature · 1 line
1.9.1
Quoted 5 lines · Hyunchul Lee
From: Hyunchul Lee <[email protected]>
Even though read operations fail,
dm_integrity_map_continue()callsintegrity_metadata()to check integrity. In this case, just complete these.
Yes this makes sense to me.
If bio->bi_status is set, it is directly propagated and the whole bio is failed.
But this is just shortcut, the bio will fail the same way (with bi_status), just integrity calculation code is skipped, so I think it should go to 4.13.
Thanks,
Milan
Quoted 24 lines
Signed-off-by Hyunchul Lee <[email protected]>--- drivers/md/dm-integrity.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)drivers/md/dm-integrity.c +5
-1@@ -1697,7 +1697,11 @@ static void dm_integrity_map_continue(struct dm_integrity_io *dio, bool from_mapif (need_sync_io) {wait_for_completion_io (&read_comp); -integrity_metadata (&dio->work); +if (likely (!bio->bi_status)) +integrity_metadata (&dio->work); +else +dec_in_flight (dio); + }else {INIT_WORK (&dio->work, integrity_metadata);queue_work (ic->metadata_wq, &dio->work);
Mikulas Patocka
maintainerQuoted 9 lines · Milan Broz
Quoted 5 lines · Hyunchul Lee
From: Hyunchul Lee <[email protected]>
Even though read operations fail,
dm_integrity_map_continue()callsintegrity_metadata()to check integrity. In this case, just complete these.Yes this makes sense to me.
Quoted 8 lines
If
bio->bi_statusis set, it is directly propagated and the whole bio is failed.But this is just shortcut, the bio will fail the same way (with
bi_status), just integrity calculation code is skipped, so I think it should go to 4.13.Thanks,
Milan
I would also mark this patch for backporting to the stable kernels - so that I/O errors do not generate integrity warnings in the log.
Mikulas
Quoted 24 lines
Quoted 23 lines
Signed-off-by Hyunchul Lee <[email protected]>--- drivers/md/dm-integrity.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)drivers/md/dm-integrity.c +5
-1@@ -1697,7 +1697,11 @@ static void dm_integrity_map_continue(struct dm_integrity_io *dio, bool from_mapif (need_sync_io) {wait_for_completion_io (&read_comp); -integrity_metadata (&dio->work); +if (likely (!bio->bi_status)) +integrity_metadata (&dio->work); +else +dec_in_flight (dio); + }else {INIT_WORK (&dio->work, integrity_metadata);queue_work (ic->metadata_wq, &dio->work);