From 70048e03d4c586e6397860cba9255626993f87f5 Mon Sep 17 00:00:00 2001 From: Hongchao Zhang Date: Fri, 21 Oct 2022 03:43:11 -0400 Subject: [PATCH] EX-4567 kernel: add extra field for snapshot in el8 Adding extra fields in "struct jbd2_journal_handle" and "struct journal_head", which are used by snapshot into the 4-byte hole at the end of struct jbd2_journal_handle so that they do not increase the structure size and memory usage for this common allocation. Use RH_KABI_EXTEND() and RH_KABI_FILL_HOLE() so that the new fields do not affect the kernel ABI compatibility. Change-Id: I84f52b18694e56d837d64c5c80076e45dde27eab Signed-off-by: Hongchao Zhang Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/48880 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Jian Yu Reviewed-by: Andreas Dilger --- .../patches/snapshot-jbd2-rhel8.3.patch | 38 ++++++++++++++++++++++ lustre/kernel_patches/series/4.18-rhel8.5.series | 1 + lustre/kernel_patches/series/4.18-rhel8.6.series | 1 + 3 files changed, 40 insertions(+) create mode 100644 lustre/kernel_patches/patches/snapshot-jbd2-rhel8.3.patch diff --git a/lustre/kernel_patches/patches/snapshot-jbd2-rhel8.3.patch b/lustre/kernel_patches/patches/snapshot-jbd2-rhel8.3.patch new file mode 100644 index 0000000..5e85c5a --- /dev/null +++ b/lustre/kernel_patches/patches/snapshot-jbd2-rhel8.3.patch @@ -0,0 +1,38 @@ +Index: linux-4.18.0-240.22.1.el8.x86_64/include/linux/jbd2.h +=================================================================== +--- linux-4.18.0-240.22.1.el8.x86_64.orig/include/linux/jbd2.h ++++ linux-4.18.0-240.22.1.el8.x86_64/include/linux/jbd2.h +@@ -528,6 +528,17 @@ struct jbd2_journal_handle + unsigned int h_requested_credits; + + unsigned int saved_alloc_context; ++ ++ /* Number of buffers requested by user: ++ * (before adding the COW credits factor) */ ++ RH_KABI_EXTEND(unsigned int h_base_credits:14) ++ /* Number of buffers the user is allowed to dirty: ++ * (counts only buffers dirtied when !h_cowing) */ ++ RH_KABI_EXTEND(unsigned int h_user_credits:14) ++ /* COWing block to snapshot */ ++ RH_KABI_EXTEND(unsigned int h_cowing:1) ++ /* in quota call path */ ++ RH_KABI_EXTEND(unsigned int h_in_quota:1) + }; + + +Index: linux-4.18.0-240.22.1.el8.x86_64/include/linux/journal-head.h +=================================================================== +--- linux-4.18.0-240.22.1.el8.x86_64.orig/include/linux/journal-head.h ++++ linux-4.18.0-240.22.1.el8.x86_64/include/linux/journal-head.h +@@ -46,6 +46,11 @@ struct journal_head { + unsigned b_modified; + + /* ++ * last transaction ID in which buffer was COWed [jbd_lock_bh_state()] ++ */ ++ RH_KABI_FILL_HOLE(unsigned b_cow_tid) ++ ++ /* + * Copy of the buffer data frozen for writing to the log. + * [jbd_lock_bh_state()] + */ diff --git a/lustre/kernel_patches/series/4.18-rhel8.5.series b/lustre/kernel_patches/series/4.18-rhel8.5.series index 076a21f..b8f3808b 100644 --- a/lustre/kernel_patches/series/4.18-rhel8.5.series +++ b/lustre/kernel_patches/series/4.18-rhel8.5.series @@ -2,3 +2,4 @@ bio-integrity-unbound-concurrency-rhel8.patch block-integrity-allow-optional-integrity-functions-rhel8.patch block-pass-bio-into-integrity_processing_fn-rhel8.patch scsi-requeue-aborted-commands-instead-of-retry-rhel8.patch +snapshot-jbd2-rhel8.3.patch diff --git a/lustre/kernel_patches/series/4.18-rhel8.6.series b/lustre/kernel_patches/series/4.18-rhel8.6.series index 076a21f..b8f3808b 100644 --- a/lustre/kernel_patches/series/4.18-rhel8.6.series +++ b/lustre/kernel_patches/series/4.18-rhel8.6.series @@ -2,3 +2,4 @@ bio-integrity-unbound-concurrency-rhel8.patch block-integrity-allow-optional-integrity-functions-rhel8.patch block-pass-bio-into-integrity_processing_fn-rhel8.patch scsi-requeue-aborted-commands-instead-of-retry-rhel8.patch +snapshot-jbd2-rhel8.3.patch -- 1.8.3.1