From: Li Dongyang Date: Sat, 15 Sep 2018 21:11:25 +0000 (-0400) Subject: ext4: don't mark mmp buffer head dirty X-Git-Tag: v4.14.73~8 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=3dc006d212e38f9efc821352d261379a38ae9eb3;p=users%2Fjedix%2Flinux-maple.git ext4: don't mark mmp buffer head dirty commit fe18d649891d813964d3aaeebad873f281627fbc upstream. 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 Signed-off-by: Theodore Ts'o Reviewed-by: Andreas Dilger Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/ext4/mmp.c b/fs/ext4/mmp.c index 638ad4743477..38e6a846aac1 100644 --- a/fs/ext4/mmp.c +++ b/fs/ext4/mmp.c @@ -49,7 +49,6 @@ static int write_mmp_block(struct super_block *sb, struct buffer_head *bh) */ 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);