Whamcloud - gitweb
LU-11187 ldiskfs: don't mark mmp buffer head dirty 36/33336/2
authorLi Dongyang <dongyangli@ddn.com>
Tue, 21 Aug 2018 00:10:45 +0000 (10:10 +1000)
committerOleg Drokin <green@whamcloud.com>
Wed, 16 Jan 2019 07:30:37 +0000 (07:30 +0000)
Marking mmp bh dirty before writing it will make writeback
pick up mmp block later and submit a write, we don't want the
duplicate write as kmmpd thread should have full control of
reading and writing the mmp block.
Another reason is we will also have random I/O error on
the writeback request when blk integrity is enabled, because
kmmpd could modify the content of the mmp block(e.g. setting
new seq and time) while the mmp block is under I/O requested
by writeback.

Linux-commit: fe18d649891d813964d3aaeebad873f281627fbc

Lustre-change: https://review.whamcloud.com/33038
Lustre-commit: dd02d32c978ad95c9e2a3703ad6be7511c257a4d

Test-Parameters: testgroup=review-ldiskfs testlist=mmp
Signed-off-by: Li Dongyang <dongyangli@ddn.com>
Change-Id: I5aa9fd384a4ea25ee52f1198528fae4ecc9c28c7
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Wang Shilong <wshilong@ddn.com>
Signed-off-by: Minh Diep <mdiep@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/33336
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
24 files changed:
ldiskfs/kernel_patches/patches/rhel6.3/ext4-mmp-dont-mark-bh-dirty.patch [new file with mode: 0644]
ldiskfs/kernel_patches/patches/rhel6.6/ext4-mmp-dont-mark-bh-dirty.patch [new file with mode: 0644]
ldiskfs/kernel_patches/patches/rhel7/ext4-mmp-dont-mark-bh-dirty.patch [new file with mode: 0644]
ldiskfs/kernel_patches/patches/sles11sp2/ext4-mmp-dont-mark-bh-dirty.patch [new file with mode: 0644]
ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.4.series
ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.5.series
ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.6.series
ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.7.series
ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.8.series
ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.9.series
ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.series
ldiskfs/kernel_patches/series/ldiskfs-2.6-sles11.series
ldiskfs/kernel_patches/series/ldiskfs-3.0-sles11.series
ldiskfs/kernel_patches/series/ldiskfs-3.0-sles11sp3.series
ldiskfs/kernel_patches/series/ldiskfs-3.0-sles11sp4.series
ldiskfs/kernel_patches/series/ldiskfs-3.10-rhel7.2.series
ldiskfs/kernel_patches/series/ldiskfs-3.10-rhel7.3.series
ldiskfs/kernel_patches/series/ldiskfs-3.10-rhel7.4.series
ldiskfs/kernel_patches/series/ldiskfs-3.10-rhel7.5.series
ldiskfs/kernel_patches/series/ldiskfs-3.10-rhel7.series
ldiskfs/kernel_patches/series/ldiskfs-3.12-sles12.series
ldiskfs/kernel_patches/series/ldiskfs-3.12-sles12sp1.series
ldiskfs/kernel_patches/series/ldiskfs-4.4-sles12sp2.series
ldiskfs/kernel_patches/series/ldiskfs-4.4-sles12sp3.series

diff --git a/ldiskfs/kernel_patches/patches/rhel6.3/ext4-mmp-dont-mark-bh-dirty.patch b/ldiskfs/kernel_patches/patches/rhel6.3/ext4-mmp-dont-mark-bh-dirty.patch
new file mode 100644 (file)
index 0000000..ed25813
--- /dev/null
@@ -0,0 +1,35 @@
+From fe18d649891d813964d3aaeebad873f281627fbc Mon Sep 17 00:00:00 2001
+From: Li Dongyang <dongyangli@ddn.com>
+Date: Sat, 15 Sep 2018 17:11:25 -0400
+Subject: [PATCH] ext4: don't mark mmp buffer head dirty
+
+Marking mmp bh dirty before writing it will make writeback
+pick up mmp block later and submit a write, we don't want the
+duplicate write as kmmpd thread should have full control of
+reading and writing the mmp block.
+Another reason is we will also have random I/O error on
+the writeback request when blk integrity is enabled, because
+kmmpd could modify the content of the mmp block(e.g. setting
+new seq and time) while the mmp block is under I/O requested
+by writeback.
+
+Signed-off-by: Li Dongyang <dongyangli@ddn.com>
+Signed-off-by: Theodore Ts'o <tytso@mit.edu>
+Reviewed-by: Andreas Dilger <adilger@dilger.ca>
+Cc: stable@vger.kernel.org
+---
+ fs/ext4/mmp.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+Index: linux-stage/fs/ext4/mmp.c
+===================================================================
+--- linux-stage.orig/fs/ext4/mmp.c
++++ linux-stage/fs/ext4/mmp.c
+@@ -12,7 +12,6 @@
+  */
+ static int write_mmp_block(struct buffer_head *bh)
+ {
+-       mark_buffer_dirty(bh);
+        lock_buffer(bh);
+        bh->b_end_io = end_buffer_write_sync;
+        get_bh(bh);
diff --git a/ldiskfs/kernel_patches/patches/rhel6.6/ext4-mmp-dont-mark-bh-dirty.patch b/ldiskfs/kernel_patches/patches/rhel6.6/ext4-mmp-dont-mark-bh-dirty.patch
new file mode 100644 (file)
index 0000000..0de707a
--- /dev/null
@@ -0,0 +1,35 @@
+From fe18d649891d813964d3aaeebad873f281627fbc Mon Sep 17 00:00:00 2001
+From: Li Dongyang <dongyangli@ddn.com>
+Date: Sat, 15 Sep 2018 17:11:25 -0400
+Subject: [PATCH] ext4: don't mark mmp buffer head dirty
+
+Marking mmp bh dirty before writing it will make writeback
+pick up mmp block later and submit a write, we don't want the
+duplicate write as kmmpd thread should have full control of
+reading and writing the mmp block.
+Another reason is we will also have random I/O error on
+the writeback request when blk integrity is enabled, because
+kmmpd could modify the content of the mmp block(e.g. setting
+new seq and time) while the mmp block is under I/O requested
+by writeback.
+
+Signed-off-by: Li Dongyang <dongyangli@ddn.com>
+Signed-off-by: Theodore Ts'o <tytso@mit.edu>
+Reviewed-by: Andreas Dilger <adilger@dilger.ca>
+Cc: stable@vger.kernel.org
+---
+ fs/ext4/mmp.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+Index: linux-stage/fs/ext4/mmp.c
+===================================================================
+--- linux-stage.orig/fs/ext4/mmp.c
++++ linux-stage/fs/ext4/mmp.c
+@@ -18,7 +18,6 @@ static int write_mmp_block(struct super_
+        * on frozen filesystem.
+        */
+       sb_start_write(sb);
+-      mark_buffer_dirty(bh);
+       lock_buffer(bh);
+       bh->b_end_io = end_buffer_write_sync;
+       get_bh(bh);
diff --git a/ldiskfs/kernel_patches/patches/rhel7/ext4-mmp-dont-mark-bh-dirty.patch b/ldiskfs/kernel_patches/patches/rhel7/ext4-mmp-dont-mark-bh-dirty.patch
new file mode 100644 (file)
index 0000000..d4be849
--- /dev/null
@@ -0,0 +1,35 @@
+From fe18d649891d813964d3aaeebad873f281627fbc Mon Sep 17 00:00:00 2001
+From: Li Dongyang <dongyangli@ddn.com>
+Date: Sat, 15 Sep 2018 17:11:25 -0400
+Subject: [PATCH] ext4: don't mark mmp buffer head dirty
+
+Marking mmp bh dirty before writing it will make writeback
+pick up mmp block later and submit a write, we don't want the
+duplicate write as kmmpd thread should have full control of
+reading and writing the mmp block.
+Another reason is we will also have random I/O error on
+the writeback request when blk integrity is enabled, because
+kmmpd could modify the content of the mmp block(e.g. setting
+new seq and time) while the mmp block is under I/O requested
+by writeback.
+
+Signed-off-by: Li Dongyang <dongyangli@ddn.com>
+Signed-off-by: Theodore Ts'o <tytso@mit.edu>
+Reviewed-by: Andreas Dilger <adilger@dilger.ca>
+Cc: stable@vger.kernel.org
+---
+ fs/ext4/mmp.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+Index: linux-3.10.0-693.21.1.el7/fs/ext4/mmp.c
+===================================================================
+--- linux-3.10.0-693.21.1.el7.orig/fs/ext4/mmp.c
++++ linux-3.10.0-693.21.1.el7/fs/ext4/mmp.c
+@@ -48,7 +48,6 @@ static int write_mmp_block(struct super_
+        */
+       sb_start_write(sb);
+       ext4_mmp_csum_set(sb, mmp);
+-      mark_buffer_dirty(bh);
+       lock_buffer(bh);
+       bh->b_end_io = end_buffer_write_sync;
+       get_bh(bh);
diff --git a/ldiskfs/kernel_patches/patches/sles11sp2/ext4-mmp-dont-mark-bh-dirty.patch b/ldiskfs/kernel_patches/patches/sles11sp2/ext4-mmp-dont-mark-bh-dirty.patch
new file mode 100644 (file)
index 0000000..3ddedd2
--- /dev/null
@@ -0,0 +1,35 @@
+From fe18d649891d813964d3aaeebad873f281627fbc Mon Sep 17 00:00:00 2001
+From: Li Dongyang <dongyangli@ddn.com>
+Date: Sat, 15 Sep 2018 17:11:25 -0400
+Subject: [PATCH] ext4: don't mark mmp buffer head dirty
+
+Marking mmp bh dirty before writing it will make writeback
+pick up mmp block later and submit a write, we don't want the
+duplicate write as kmmpd thread should have full control of
+reading and writing the mmp block.
+Another reason is we will also have random I/O error on
+the writeback request when blk integrity is enabled, because
+kmmpd could modify the content of the mmp block(e.g. setting
+new seq and time) while the mmp block is under I/O requested
+by writeback.
+
+Signed-off-by: Li Dongyang <dongyangli@ddn.com>
+Signed-off-by: Theodore Ts'o <tytso@mit.edu>
+Reviewed-by: Andreas Dilger <adilger@dilger.ca>
+Cc: stable@vger.kernel.org
+---
+ fs/ext4/mmp.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+Index: linux-stage/fs/ext4/mmp.c
+===================================================================
+--- linux-stage.orig/fs/ext4/mmp.c
++++ linux-stage/fs/ext4/mmp.c
+@@ -12,7 +12,6 @@
+  */
+ static int write_mmp_block(struct buffer_head *bh)
+ {
+-      mark_buffer_dirty(bh);
+       lock_buffer(bh);
+       bh->b_end_io = end_buffer_write_sync;
+       get_bh(bh);
index 1947efd..abf90a6 100644 (file)
@@ -44,3 +44,4 @@ rhel6.3/ext4-drop-inode-from-orphan-list-if-ext4_delete_inode-fails.patch
 rhel6.3/ext4-notalloc_under_idatasem.patch
 rhel6.3/ext4-dont-check-in-ro.patch
 rhel6.3/ext4-dont-check-before-replay.patch
+rhel6.3/ext4-mmp-dont-mark-bh-dirty.patch
index e662543..970bf52 100644 (file)
@@ -48,3 +48,4 @@ rhel6.5/ext4-fix-journal-quota.patch
 rhel6.3/ext4-dont-check-in-ro.patch
 rhel6.3/ext4-dont-check-before-replay.patch
 rhel6.5/ext4-brackets-in-ext4-remove-blocks.patch
+rhel6.3/ext4-mmp-dont-mark-bh-dirty.patch
index 84962a9..4180e13 100644 (file)
@@ -48,3 +48,4 @@ rhel6.5/ext4-give-warning-with-dir-htree-growing.patch
 rhel6.6/ext4_s_max_ext_tree_depth.patch
 rhel6.5/ext4-fix-journal-quota.patch
 rhel6.5/ext4-brackets-in-ext4-remove-blocks.patch
+rhel6.6/ext4-mmp-dont-mark-bh-dirty.patch
index 51b6734..015fef2 100644 (file)
@@ -47,3 +47,4 @@ rhel6.5/ext4-give-warning-with-dir-htree-growing.patch
 rhel6.6/ext4_s_max_ext_tree_depth.patch
 rhel6.5/ext4-fix-journal-quota.patch
 rhel6.5/ext4-brackets-in-ext4-remove-blocks.patch
+rhel6.6/ext4-mmp-dont-mark-bh-dirty.patch
index 70b2e61..f1ae10d 100644 (file)
@@ -45,3 +45,4 @@ rhel6.5/ext4-give-warning-with-dir-htree-growing.patch
 rhel6.6/ext4_s_max_ext_tree_depth.patch
 rhel6.5/ext4-fix-journal-quota.patch
 rhel6.5/ext4-brackets-in-ext4-remove-blocks.patch
+rhel6.6/ext4-mmp-dont-mark-bh-dirty.patch
index 0c650e4..f4f0a3d 100644 (file)
@@ -44,3 +44,4 @@ rhel6.3/ext4-notalloc_under_idatasem.patch
 rhel6.5/ext4-give-warning-with-dir-htree-growing.patch
 rhel6.6/ext4_s_max_ext_tree_depth.patch
 rhel6.5/ext4-fix-journal-quota.patch
+rhel6.6/ext4-mmp-dont-mark-bh-dirty.patch
index 178e310..862ee3c 100644 (file)
@@ -43,3 +43,4 @@ rhel6.3/ext4-recalc-percpu-counters-after-journal.patch
 rhel6.3/ext4-notalloc_under_idatasem.patch
 rhel6.3/ext4-dont-check-in-ro.patch
 rhel6.3/ext4-dont-check-before-replay.patch
+rhel6.3/ext4-mmp-dont-mark-bh-dirty.patch
index ffffacc..c692f10 100644 (file)
@@ -43,3 +43,4 @@ rhel6.3/ext4-journal-path-opt.patch
 rhel6.3/ext4-recalc-percpu-counters-after-journal.patch
 rhel6.3/ext4-notalloc_under_idatasem.patch
 rhel6.5/ext4-fix-journal-quota.patch
+rhel6.3/ext4-mmp-dont-mark-bh-dirty.patch
index dc96ece..1961d04 100644 (file)
@@ -5,7 +5,6 @@ sles11sp2/ext4-use-ext4_msg-instead-of-printk-in-mballoc.patch
 sles11sp2/revert-ext4-avoid-uninitialized-memory-references-in-ext3_htree_next_block.patch
 sles11sp2/ext4-journal-callback.patch
 sles11sp2/ext4-make-quota-as-first-class-supported-feature.patch
-
 sles11sp2/ext4-handle-cleanup-after-quota-failure.patch
 sles11sp2/ext4-map_inode_page-3.0.patch
 sles11sp2/export-ext4-3.0.patch
@@ -40,3 +39,4 @@ rhel6.3/ext4-journal-path-opt.patch
 sles11sp3/ext4_s_max_ext_tree_depth.patch
 sles11sp1/ext4-notalloc_under_idatasem.patch
 rhel6.5/ext4-fix-journal-quota.patch
+sles11sp2/ext4-mmp-dont-mark-bh-dirty.patch
index be27380..53c2d10 100644 (file)
@@ -5,7 +5,6 @@ sles11sp2/ext4-use-ext4_msg-instead-of-printk-in-mballoc.patch
 sles11sp2/revert-ext4-avoid-uninitialized-memory-references-in-ext3_htree_next_block.patch
 sles11sp2/ext4-journal-callback.patch
 sles11sp2/ext4-make-quota-as-first-class-supported-feature.patch
-
 sles11sp2/ext4-handle-cleanup-after-quota-failure.patch
 sles11sp2/ext4-map_inode_page-3.0.patch
 sles11sp2/export-ext4-3.0.patch
@@ -44,3 +43,4 @@ sles11sp1/ext4-notalloc_under_idatasem.patch
 rhel6.5/ext4-fix-journal-quota.patch
 sles11sp3/ext4-dont-check-before-replay.patch
 rhel6.3/ext4-dont-check-in-ro.patch
+sles11sp2/ext4-mmp-dont-mark-bh-dirty.patch
index 99096f2..e15b624 100644 (file)
@@ -5,7 +5,6 @@ sles11sp2/ext4-use-ext4_msg-instead-of-printk-in-mballoc.patch
 sles11sp2/revert-ext4-avoid-uninitialized-memory-references-in-ext3_htree_next_block.patch
 sles11sp2/ext4-journal-callback.patch
 sles11sp2/ext4-make-quota-as-first-class-supported-feature.patch
-
 sles11sp2/ext4-handle-cleanup-after-quota-failure.patch
 sles11sp2/ext4-map_inode_page-3.0.patch
 sles11sp2/export-ext4-3.0.patch
@@ -44,3 +43,4 @@ sles11sp1/ext4-notalloc_under_idatasem.patch
 rhel6.5/ext4-fix-journal-quota.patch
 sles11sp3/ext4-dont-check-before-replay.patch
 rhel6.3/ext4-dont-check-in-ro.patch
+sles11sp2/ext4-mmp-dont-mark-bh-dirty.patch
index 87ea5b4..6a38507 100644 (file)
@@ -33,3 +33,4 @@ rhel7/ext4-fix-xattr-shifting-when-expanding-inodes.patch
 rhel7/ext4-cleanup-goto-next-group.patch
 rhel7/ext4-reduce-lock-contention-in-__ext4_new_inode.patch
 rhel7/ext4-use-GFP_NOFS-in-ext4_inode_attach_jinode.patch
+rhel7/ext4-mmp-dont-mark-bh-dirty.patch
index ae19bc5..0974e8b 100644 (file)
@@ -33,3 +33,4 @@ rhel7.2/ext4-dont-check-before-replay.patch
 rhel7/ext4-cleanup-goto-next-group.patch
 rhel7/ext4-reduce-lock-contention-in-__ext4_new_inode.patch
 rhel7/ext4-use-GFP_NOFS-in-ext4_inode_attach_jinode.patch
+rhel7/ext4-mmp-dont-mark-bh-dirty.patch
index 6c5d0bc..32c88ca 100644 (file)
@@ -33,3 +33,4 @@ rhel7.4/ext4-dont-check-before-replay.patch
 rhel7/ext4-cleanup-goto-next-group.patch
 rhel7/ext4-reduce-lock-contention-in-__ext4_new_inode.patch
 rhel7/ext4-use-GFP_NOFS-in-ext4_inode_attach_jinode.patch
+rhel7/ext4-mmp-dont-mark-bh-dirty.patch
index ec2af3b..ca60820 100644 (file)
@@ -30,3 +30,4 @@ rhel7.4/ext4-attach-jinode-in-writepages.patch
 rhel6.3/ext4-dont-check-in-ro.patch
 rhel7.4/ext4-dont-check-before-replay.patch
 rhel7/ext4-use-GFP_NOFS-in-ext4_inode_attach_jinode.patch
+rhel7/ext4-mmp-dont-mark-bh-dirty.patch
index 9cc8057..835a23c 100644 (file)
@@ -29,3 +29,4 @@ rhel7/ext4-projid-xfs-ioctls.patch
 rhel7/ext4-fix-xattr-shifting-when-expanding-inodes.patch
 rhel7/ext4-cleanup-goto-next-group.patch
 rhel7/ext4-reduce-lock-contention-in-__ext4_new_inode.patch
+rhel7/ext4-mmp-dont-mark-bh-dirty.patch
index 286fbf1..bcc0216 100644 (file)
@@ -20,3 +20,4 @@ sles12/ext4-corrupted-inode-block-bitmaps-handling-patches.patch
 rhel7/ext4-give-warning-with-dir-htree-growing.patch
 rhel7/ext4-mmp-brelse.patch
 rhel7/ext4-jcb-optimization.patch
+rhel7/ext4-mmp-dont-mark-bh-dirty.patch
index 03ce6e3..4b622a8 100644 (file)
@@ -21,3 +21,4 @@ rhel7/ext4-give-warning-with-dir-htree-growing.patch
 rhel7/ext4-mmp-brelse.patch
 rhel7/ext4-jcb-optimization.patch
 sles12sp1/ext4-attach-jinode-in-writepages.patch
+rhel7/ext4-mmp-dont-mark-bh-dirty.patch
index ad382f1..f2e6460 100644 (file)
@@ -25,3 +25,4 @@ sles12sp2/ext4-dont-check-before-replay.patch
 rhel7.2/ext4-dont-check-in-ro.patch
 sles12sp2/ext4-fix-xattr-shifting-when-expanding-inodes.patch
 rhel7/ext4-use-GFP_NOFS-in-ext4_inode_attach_jinode.patch
+rhel7/ext4-mmp-dont-mark-bh-dirty.patch
index e9da9d1..33cabd6 100644 (file)
@@ -25,3 +25,4 @@ sles12sp3/ext4-dont-check-before-replay.patch
 rhel7.2/ext4-dont-check-in-ro.patch
 sles12sp2/ext4-fix-xattr-shifting-when-expanding-inodes.patch
 rhel7/ext4-use-GFP_NOFS-in-ext4_inode_attach_jinode.patch
+rhel7/ext4-mmp-dont-mark-bh-dirty.patch