Whamcloud - gitweb
LU-13479 kernel: only enable integrity metadata for reads and writes 24/38324/2
authorLi Dongyang <dongyangli@ddn.com>
Thu, 23 Apr 2020 01:16:34 +0000 (11:16 +1000)
committerOleg Drokin <green@whamcloud.com>
Fri, 1 May 2020 04:27:30 +0000 (04:27 +0000)
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 <dongyangli@ddn.com>
Reviewed-on: https://review.whamcloud.com/38324
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Li Xi <lixi@ddn.com>
Reviewed-by: Yang Sheng <ys@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/kernel_patches/patches/block-Ensure-we-only-enable-integrity-metadata-for-reads-and-writes-rhel7.patch [new file with mode: 0644]
lustre/kernel_patches/series/3.10-rhel7.6.series
lustre/kernel_patches/series/3.10-rhel7.7.series
lustre/kernel_patches/series/3.10-rhel7.8.series

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 (file)
index 0000000..04cf972
--- /dev/null
@@ -0,0 +1,33 @@
+From e69f18f06b97ed29645d020500222bfcec2b42b2 Mon Sep 17 00:00:00 2001
+From: "Martin K. Petersen" <martin.petersen@oracle.com>
+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 <martin.petersen@oracle.com>
+Signed-off-by: Jens Axboe <axboe@fb.com>
+---
+ 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
+
index 9109c9b..725e620 100644 (file)
@@ -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
index 9109c9b..725e620 100644 (file)
@@ -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
index 3e2b0ef..5c5dfd6 100644 (file)
@@ -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