diff mbox series

ext4: don't mark mmp buffer head dirty

Message ID 20180909063028.22148-1-dongyangli@ddn.com
State Accepted, archived
Headers show
Series ext4: don't mark mmp buffer head dirty | expand

Commit Message

Li Dongyang Sept. 9, 2018, 6:30 a.m. UTC
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>
Cc: Andreas Dilger <adilger@dilger.ca>
---
 fs/ext4/mmp.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Andreas Dilger Sept. 10, 2018, 4:57 a.m. UTC | #1
On Sep 9, 2018, at 12:30 AM, Li Dongyang <dongyangli@ddn.com> wrote:
> 
> 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>
> Cc: Andreas Dilger <adilger@dilger.ca>

Reviewed-by: Andreas Dilger <adilger@dilger.ca>

> ---
> fs/ext4/mmp.c | 1 -
> 1 file changed, 1 deletion(-)
> 
> diff --git a/fs/ext4/mmp.c b/fs/ext4/mmp.c
> index 39b07c2d3384..2305b4374fd3 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);
> --
> 2.18.0
> 


Cheers, Andreas
Theodore Ts'o Sept. 15, 2018, 9:12 p.m. UTC | #2
On Sun, Sep 09, 2018 at 10:57:35PM -0600, Andreas Dilger wrote:
> On Sep 9, 2018, at 12:30 AM, Li Dongyang <dongyangli@ddn.com> wrote:
> > 
> > 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>
> > Cc: Andreas Dilger <adilger@dilger.ca>
> 
> Reviewed-by: Andreas Dilger <adilger@dilger.ca>

Thanks, applied.

				- Ted
diff mbox series

Patch

diff --git a/fs/ext4/mmp.c b/fs/ext4/mmp.c
index 39b07c2d3384..2305b4374fd3 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);