From b90c0100dd93b56f3bfaee037b3bdd077523f43e Mon Sep 17 00:00:00 2001 From: Jian Yu Date: Tue, 20 Sep 2022 11:19:12 -0700 Subject: [PATCH] LU-16138 kernel: preserve RHEL8.x server kABI for block integrity Currently there are two kernel patches supporting SCSI T10-PI feature left in the RHEL8.x series: - block-integrity-allow-optional-integrity-functions-rhel8.patch - block-pass-bio-into-integrity_processing_fn-rhel8.patch The changes in the patches modified "struct bio_integrity_payload" and "struct blk_integrity_iter", which caused kABI breakage. This patch fixes the patches to preserve kABI by using RH-supplied compatibility macros. Test-Parameters: trivial fstype=ldiskfs clientdistro=el8.5 serverdistro=el8.5 Test-Parameters: trivial fstype=ldiskfs clientdistro=el8.6 serverdistro=el8.6 Change-Id: If547e1cd4ae4ff1affd315bbfefaeeff4f1dea81 Signed-off-by: Jian Yu Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/48608 Reviewed-by: Andreas Dilger Reviewed-by: Li Dongyang Reviewed-by: Oleg Drokin Tested-by: jenkins Tested-by: Maloo --- ...y-allow-optional-integrity-functions-rhel8.patch | 21 +++++++++++---------- ...ass-bio-into-integrity_processing_fn-rhel8.patch | 12 ++++++------ 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/lustre/kernel_patches/patches/block-integrity-allow-optional-integrity-functions-rhel8.patch b/lustre/kernel_patches/patches/block-integrity-allow-optional-integrity-functions-rhel8.patch index 5381f2a..5b4ba43 100644 --- a/lustre/kernel_patches/patches/block-integrity-allow-optional-integrity-functions-rhel8.patch +++ b/lustre/kernel_patches/patches/block-integrity-allow-optional-integrity-functions-rhel8.patch @@ -164,22 +164,23 @@ Index: linux-4.18.0-80.el8/block/bio-integrity.c if (IS_ERR(bip)) return PTR_ERR(bip); -Index: linux-4.18.0-80.el8/include/linux/bio.h +Index: linux-4.18.0-372.19.1.el8_6/include/linux/bio.h =================================================================== ---- linux-4.18.0-80.el8.orig/include/linux/bio.h -+++ linux-4.18.0-80.el8/include/linux/bio.h -@@ -313,6 +313,10 @@ struct bio_integrity_payload { +--- linux-4.18.0-372.19.1.el8_6.orig/include/linux/bio.h ++++ linux-4.18.0-372.19.1.el8_6/include/linux/bio.h +@@ -307,8 +307,9 @@ struct bio_integrity_payload { struct bio_vec *bip_vec; +- RH_KABI_RESERVE(1) +- RH_KABI_RESERVE(2) + /* put after bip_vec as that is last externally-accessed bip_ field */ -+ integrity_processing_fn *bip_generate_fn; -+ integrity_processing_fn *bip_verify_fn; -+ - RH_KABI_RESERVE(1) - RH_KABI_RESERVE(2) ++ RH_KABI_USE(1, integrity_processing_fn *bip_generate_fn) ++ RH_KABI_USE(2, integrity_processing_fn *bip_verify_fn) -@@ -760,6 +764,11 @@ static inline bool bioset_initialized(st + struct bio_vec bip_inline_vecs[0];/* embedded bvec array */ + }; +@@ -728,6 +729,11 @@ static inline bool bioset_initialized(st bip_for_each_vec(_bvl, _bio->bi_integrity, _iter) extern struct bio_integrity_payload *bio_integrity_alloc(struct bio *, gfp_t, unsigned int); diff --git a/lustre/kernel_patches/patches/block-pass-bio-into-integrity_processing_fn-rhel8.patch b/lustre/kernel_patches/patches/block-pass-bio-into-integrity_processing_fn-rhel8.patch index b5864b7..44c97e7 100644 --- a/lustre/kernel_patches/patches/block-pass-bio-into-integrity_processing_fn-rhel8.patch +++ b/lustre/kernel_patches/patches/block-pass-bio-into-integrity_processing_fn-rhel8.patch @@ -36,17 +36,17 @@ Index: linux-4.18.0/block/bio-integrity.c } return ret; } -Index: linux-4.18.0/include/linux/blkdev.h +Index: linux-4.18.0-372.19.1.el8_6/include/linux/blkdev.h =================================================================== ---- linux-4.18.0.orig/include/linux/blkdev.h -+++ linux-4.18.0/include/linux/blkdev.h -@@ -1802,7 +1802,9 @@ struct blk_integrity_iter { +--- linux-4.18.0-372.19.1.el8_6.orig/include/linux/blkdev.h ++++ linux-4.18.0-372.19.1.el8_6/include/linux/blkdev.h +@@ -1615,7 +1615,9 @@ struct blk_integrity_iter { sector_t seed; unsigned int data_size; unsigned short interval; -+ unsigned short bi_idx; ++ RH_KABI_FILL_HOLE(unsigned short bi_idx) const char *disk_name; -+ struct bio *bio; ++ RH_KABI_EXTEND(struct bio *bio) }; typedef blk_status_t (integrity_processing_fn) (struct blk_integrity_iter *); -- 1.8.3.1