Whamcloud - gitweb
EX-4567 kernel: add extra field for snapshot in el8
authorHongchao Zhang <hongchao@whamcloud.com>
Fri, 21 Oct 2022 07:43:11 +0000 (03:43 -0400)
committerAndreas Dilger <adilger@whamcloud.com>
Thu, 27 Oct 2022 03:21:55 +0000 (03:21 +0000)
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 <hongchao@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/48880
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/kernel_patches/patches/snapshot-jbd2-rhel8.3.patch [new file with mode: 0644]
lustre/kernel_patches/series/4.18-rhel8.5.series
lustre/kernel_patches/series/4.18-rhel8.6.series

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 (file)
index 0000000..5e85c5a
--- /dev/null
@@ -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()]
+        */
index 076a21f..b8f3808 100644 (file)
@@ -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
index 076a21f..b8f3808 100644 (file)
@@ -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