Whamcloud - gitweb
LU-17248 kernel: add SB_I_STABLE_WRITES to bdev sb flag 22/52922/1
authorLi Dongyang <dongyangli@ddn.com>
Wed, 1 Nov 2023 11:36:10 +0000 (22:36 +1100)
committerLi Dongyang <dongyangli@ddn.com>
Wed, 1 Nov 2023 11:36:10 +0000 (22:36 +1100)
Since RHEL 8.6 wait_for_stable_page() is controlled by
a new flag SB_I_STABLE_WRITES on the super block.

However the new flag is not set on the bdev pseudo sb,
which mean when doing write directly to the block device
we are not waiting on page writeback, this could trigger
false block integrity errors, as page could be modified
again when under writeback, the integrity checksum does
not match the new data any more.

Change-Id: Ie088abf29f40b294c31f993bcfad56d6081a3fce
Test-Parameters: trivial
Signed-off-by: Li Dongyang <dongyangli@ddn.com>
lustre/kernel_patches/patches/block-add-SB_I_STABLE_WRITES-to-bdev-sb-flag-rhel8.6.patch [new file with mode: 0644]
lustre/kernel_patches/patches/block-add-SB_I_STABLE_WRITES-to-bdev-sb-flag-rhel9.patch [new file with mode: 0644]
lustre/kernel_patches/series/4.18-rhel8.6.series
lustre/kernel_patches/series/4.18-rhel8.7.series
lustre/kernel_patches/series/4.18-rhel8.8.series
lustre/kernel_patches/series/5.14-rhel9.1.series
lustre/kernel_patches/series/5.14-rhel9.2.series

diff --git a/lustre/kernel_patches/patches/block-add-SB_I_STABLE_WRITES-to-bdev-sb-flag-rhel8.6.patch b/lustre/kernel_patches/patches/block-add-SB_I_STABLE_WRITES-to-bdev-sb-flag-rhel8.6.patch
new file mode 100644 (file)
index 0000000..6c4a32c
--- /dev/null
@@ -0,0 +1,13 @@
+Index: linux-4.18.0-372.32.1.el8_6/fs/block_dev.c
+===================================================================
+--- linux-4.18.0-372.32.1.el8_6.orig/fs/block_dev.c
++++ linux-4.18.0-372.32.1.el8_6/fs/block_dev.c
+@@ -888,7 +888,7 @@ static int bd_init_fs_context(struct fs_
+       struct pseudo_fs_context *ctx = init_pseudo(fc, BDEVFS_MAGIC);
+       if (!ctx)
+               return -ENOMEM;
+-      fc->s_iflags |= SB_I_CGROUPWB;
++      fc->s_iflags |= SB_I_CGROUPWB | SB_I_STABLE_WRITES;
+       ctx->ops = &bdev_sops;
+       return 0;
+ }
diff --git a/lustre/kernel_patches/patches/block-add-SB_I_STABLE_WRITES-to-bdev-sb-flag-rhel9.patch b/lustre/kernel_patches/patches/block-add-SB_I_STABLE_WRITES-to-bdev-sb-flag-rhel9.patch
new file mode 100644 (file)
index 0000000..a83d00f
--- /dev/null
@@ -0,0 +1,13 @@
+Index: linux-5.14.0-162.23.1.el9_1/block/bdev.c
+===================================================================
+--- linux-5.14.0-162.23.1.el9_1.orig/block/bdev.c
++++ linux-5.14.0-162.23.1.el9_1/block/bdev.c
+@@ -444,7 +444,7 @@ static int bd_init_fs_context(struct fs_
+       struct pseudo_fs_context *ctx = init_pseudo(fc, BDEVFS_MAGIC);
+       if (!ctx)
+               return -ENOMEM;
+-      fc->s_iflags |= SB_I_CGROUPWB;
++      fc->s_iflags |= SB_I_CGROUPWB | SB_I_STABLE_WRITES;
+       ctx->ops = &bdev_sops;
+       return 0;
+ }
index 0719776..7390fbf 100644 (file)
@@ -2,3 +2,4 @@ block-bio-integrity-Advance-seed-correctly-for-large.patch
 block-integrity-allow-optional-integrity-functions-rhel8.3.patch
 block-pass-bio-into-integrity_processing_fn-rhel8.patch
 jbd2-revoke-rhashtable-rhel8.4.patch
+block-add-SB_I_STABLE_WRITES-to-bdev-sb-flag-rhel8.6.patch
index 4b95dad..78919c8 100644 (file)
@@ -1,3 +1,4 @@
 block-integrity-allow-optional-integrity-functions-rhel8.3.patch
 block-pass-bio-into-integrity_processing_fn-rhel8.patch
 jbd2-revoke-rhashtable-rhel8.4.patch
+block-add-SB_I_STABLE_WRITES-to-bdev-sb-flag-rhel8.6.patch
index 4b95dad..78919c8 100644 (file)
@@ -1,3 +1,4 @@
 block-integrity-allow-optional-integrity-functions-rhel8.3.patch
 block-pass-bio-into-integrity_processing_fn-rhel8.patch
 jbd2-revoke-rhashtable-rhel8.4.patch
+block-add-SB_I_STABLE_WRITES-to-bdev-sb-flag-rhel8.6.patch
index 419e3c4..2e2dbb7 100644 (file)
@@ -1,2 +1,3 @@
 block-integrity-allow-optional-integrity-functions-rhel9.1.patch
 block-pass-bio-into-integrity_processing_fn-rhel9.patch
+block-add-SB_I_STABLE_WRITES-to-bdev-sb-flag-rhel9.patch
index 419e3c4..2e2dbb7 100644 (file)
@@ -1,2 +1,3 @@
 block-integrity-allow-optional-integrity-functions-rhel9.1.patch
 block-pass-bio-into-integrity_processing_fn-rhel9.patch
+block-add-SB_I_STABLE_WRITES-to-bdev-sb-flag-rhel9.patch