From: Li Dongyang Date: Thu, 23 Apr 2020 01:16:34 +0000 (+1000) Subject: LU-13479 kernel: only enable integrity metadata for reads and writes X-Git-Tag: 2.13.54~145 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=e275c5a384e97a43be63c43ae7e61c6baf7e6e7c LU-13479 kernel: only enable integrity metadata for reads and writes We should not enable integrity for discard bio, it will fail the integrity allocation and the discard bio will end with EIO. Linux-commit: e69f18f06b97ed29645d020500222bfcec2b42b2 Test-Parameters: trivial clientdistro=el7.8 serverdistro=el7.8 Change-Id: I1fc9c6c7a6c53a6287466927ecfbb9af1f2a8f27 Signed-off-by: Li Dongyang Reviewed-on: https://review.whamcloud.com/38324 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Li Xi Reviewed-by: Yang Sheng Reviewed-by: Oleg Drokin --- diff --git a/lustre/kernel_patches/patches/block-Ensure-we-only-enable-integrity-metadata-for-reads-and-writes-rhel7.patch b/lustre/kernel_patches/patches/block-Ensure-we-only-enable-integrity-metadata-for-reads-and-writes-rhel7.patch new file mode 100644 index 0000000..04cf972 --- /dev/null +++ b/lustre/kernel_patches/patches/block-Ensure-we-only-enable-integrity-metadata-for-reads-and-writes-rhel7.patch @@ -0,0 +1,33 @@ +From e69f18f06b97ed29645d020500222bfcec2b42b2 Mon Sep 17 00:00:00 2001 +From: "Martin K. Petersen" +Date: Tue, 8 Apr 2014 22:59:31 -0400 +Subject: [PATCH] block: Ensure we only enable integrity metadata for reads and + writes + +We'd occasionally attempt to generate protection information for flushes +and other requests with a zero payload. Make sure we only attempt to +enable integrity for reads and writes. + +Signed-off-by: Martin K. Petersen +Signed-off-by: Jens Axboe +--- + fs/bio-integrity.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/fs/bio-integrity.c b/fs/bio-integrity.c +index b355b98dbf1b..1c2ce0c87711 100644 +--- a/fs/bio-integrity.c ++++ b/fs/bio-integrity.c +@@ -182,6 +182,9 @@ static int bdev_integrity_enabled(struct block_device *bdev, int rw) + */ + int bio_integrity_enabled(struct bio *bio) + { ++ if (!bio_is_rw(bio)) ++ return 0; ++ + /* Already protected? */ + if (bio_integrity(bio)) + return 0; +-- +2.26.1 + diff --git a/lustre/kernel_patches/series/3.10-rhel7.6.series b/lustre/kernel_patches/series/3.10-rhel7.6.series index 9109c9b..725e620 100644 --- a/lustre/kernel_patches/series/3.10-rhel7.6.series +++ b/lustre/kernel_patches/series/3.10-rhel7.6.series @@ -6,3 +6,4 @@ fix-sd-dif-complete-rhel7.patch block-integrity-allow-optional-integrity-functions-rhel7.patch block-pass-bio-into-integrity_processing_fn-rhel7.patch dm-fix-handle-BLK_MQ_RQ_QUEUE_DEV_BUSY-rhel7.6.patch +block-Ensure-we-only-enable-integrity-metadata-for-reads-and-writes-rhel7.patch diff --git a/lustre/kernel_patches/series/3.10-rhel7.7.series b/lustre/kernel_patches/series/3.10-rhel7.7.series index 9109c9b..725e620 100644 --- a/lustre/kernel_patches/series/3.10-rhel7.7.series +++ b/lustre/kernel_patches/series/3.10-rhel7.7.series @@ -6,3 +6,4 @@ fix-sd-dif-complete-rhel7.patch block-integrity-allow-optional-integrity-functions-rhel7.patch block-pass-bio-into-integrity_processing_fn-rhel7.patch dm-fix-handle-BLK_MQ_RQ_QUEUE_DEV_BUSY-rhel7.6.patch +block-Ensure-we-only-enable-integrity-metadata-for-reads-and-writes-rhel7.patch diff --git a/lustre/kernel_patches/series/3.10-rhel7.8.series b/lustre/kernel_patches/series/3.10-rhel7.8.series index 3e2b0ef..5c5dfd61c 100644 --- a/lustre/kernel_patches/series/3.10-rhel7.8.series +++ b/lustre/kernel_patches/series/3.10-rhel7.8.series @@ -3,3 +3,4 @@ fix-integrity-verify-rhel7.patch fix-sd-dif-complete-rhel7.patch block-integrity-allow-optional-integrity-functions-rhel7.patch block-pass-bio-into-integrity_processing_fn-rhel7.patch +block-Ensure-we-only-enable-integrity-metadata-for-reads-and-writes-rhel7.patch