From patchwork Sun Sep 9 06:30:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Dongyang X-Patchwork-Id: 967715 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-ext4-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ddn.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 427LzT313Rz9s2P for ; Sun, 9 Sep 2018 16:36:05 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726560AbeIILYg (ORCPT ); Sun, 9 Sep 2018 07:24:36 -0400 Received: from mail2-drop-p3.anu.edu.au ([130.56.64.39]:60980 "EHLO mail2-drop-p3.anu.edu.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726489AbeIILYf (ORCPT ); Sun, 9 Sep 2018 07:24:35 -0400 X-Greylist: delayed 309 seconds by postgrey-1.27 at vger.kernel.org; Sun, 09 Sep 2018 07:24:34 EDT Received: from mailpmx4.anu.edu.au (snatpool01-5.anu.edu.au [130.56.66.109]) by mail2-drop-p3.anu.edu.au (8.14.7/8.14.7) with ESMTP id w896UnfJ013804; Sun, 9 Sep 2018 16:30:49 +1000 Received: from mailpmx4.anu.edu.au (localhost [127.0.0.1]) by localhost (Postfix) with SMTP id D1B0E80BF0; Sun, 9 Sep 2018 16:30:49 +1000 (AEST) Received: from smtphost.anu.edu.au (snatpool01-2.anu.edu.au [130.56.66.106]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by mailpmx4.anu.edu.au (Postfix) with ESMTPS id 32FA880BB7; Sun, 9 Sep 2018 16:30:47 +1000 (AEST) Received: from X1C6.localdomain (8.25.220.111.sta.wbroadband.net.au [111.220.25.8]) (authenticated bits=0) by smtphost.anu.edu.au (8.13.8/8.13.8) with ESMTP id w896UUB2006611 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 9 Sep 2018 16:30:47 +1000 From: Li Dongyang To: linux-ext4@vger.kernel.org Cc: adilger@dilger.ca Subject: [PATCH] ext4: don't mark mmp buffer head dirty Date: Sun, 9 Sep 2018 16:30:28 +1000 Message-Id: <20180909063028.22148-1-dongyangli@ddn.com> X-Mailer: git-send-email 2.18.0 X-PMX-Version: 6.4.5.2775670, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2018.9.9.62416, AntiVirus-Engine: 5.52.0, AntiVirus-Data: 2018.9.9.5520001 internal X-OriginatorOrg: anu.edu.au X-PMX-Info: authenticated X-PerlMx-Spam: Gauge=IIIIIIII, Probability=8%, Report=' HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1000_1099 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, NO_URI_HTTPS 0, RDNS_GENERIC_POOLED 0, RDNS_SUSP 0, RDNS_SUSP_GENERIC 0, SPF_UNKNOWN 0, __ANY_URI 0, __HAS_CC_HDR 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __MIME_TEXT_ONLY 0, __MIME_TEXT_P 0, __MIME_TEXT_P1 0, __NO_HTML_TAG_RAW 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS ' Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org 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 Cc: Andreas Dilger Reviewed-by: Andreas Dilger --- 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);