Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2813847pxu; Mon, 14 Dec 2020 11:29:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJz+9KGxDVLZWEvtVf0f7zhGBMn32O7g0MJLX5YJYgL0Tm+qIT/z5oA3/KgU/ZAiD3Tin+bu X-Received: by 2002:a17:906:604e:: with SMTP id p14mr23851271ejj.543.1607974147036; Mon, 14 Dec 2020 11:29:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607974147; cv=none; d=google.com; s=arc-20160816; b=ednvIgsmiQ1PJasSE1eFs4MBSEpU53sG6IUrhbdhuJVxUk9SZzk3UTf6NPMEpJf6ze kXjJQcQ+fqcjagSnv0cXLV7JuRZxKbzTh4ile/4oW37gs6k283absf16BnY3i2ThGT33 SOzoGksu3oiuvbFmCpwdoUPHLR44uqMeht/PAJf+Nxk+eIpjWpURp6x8lIjuhBRek3va ngK9X10N85CpKW5H9pXwDw1/ItdBjxD98VFNkVd769juDH6vwQWqwk+5uKxQeh21mhsb 9pUVlRG9FuWBwke6+hK9uiM/qjBhejUfil3VnOTrhSeheFMQjkad4MiNTBCjTz9AXq4w pZCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=uGakVfnUHTotaBa8u50t+RuW90jXuEMteJbj2e6oUjA=; b=QBO7e+xpmUEAy4XxFiuu73Ujo0NS9t+dtFWFBhHRnyXjQ+HboesCiZW4EzxWTbyN0h Yj7XcKO0OziMIB6ZLxMJBgIYBcXn4aYNdDxWT0HAOmhIOlelEFht/Vp+Y4Dfh2GImJ9H Xg7sXX82pSFdOu/sxfwhHzzv3OUSAwc2Z8XEY7BQUEBLIBP5BeB3qDPRpdA1VJabjA5O 2ZE2LClxtgIX25svMsjWijEDpOL2OnCNXcIN7CqMW8jVqjjSwrGNfbcmT+/gjHOZsOHV RpfYqeQpDOk7yfjc9CcnE5AZBukFke9RouQMEOhifWr3rNC6kqL8uZ3kEF8IQvbEugHH +ULA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZBrSEKxt; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f17si9344257edx.585.2020.12.14.11.28.42; Mon, 14 Dec 2020 11:29:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZBrSEKxt; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2440528AbgLNT0k (ORCPT + 99 others); Mon, 14 Dec 2020 14:26:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2440454AbgLNT0Q (ORCPT ); Mon, 14 Dec 2020 14:26:16 -0500 Received: from mail-ed1-x543.google.com (mail-ed1-x543.google.com [IPv6:2a00:1450:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CEDE6C0613D6 for ; Mon, 14 Dec 2020 11:25:35 -0800 (PST) Received: by mail-ed1-x543.google.com with SMTP id b2so18428516edm.3 for ; Mon, 14 Dec 2020 11:25:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=uGakVfnUHTotaBa8u50t+RuW90jXuEMteJbj2e6oUjA=; b=ZBrSEKxtZNtKx+vOiGN9Oxpjj7oMBAoEx0+GmFYdB4xCKIDpRu7FDirDAUOiSKllOC srfajQP0WfHJNP0mqzXcm57IDlNSNnt3DLMALni2/Rw9451w+C+Il+0JAg1DJ8SiY3jT gVpYc0S0V64fP5fa8MSQeE0kSL+HvTNRMTkehA83Uvx0sBqloy6mLrhMC5mLaVzOhbc9 DCV4jxIjis73yAVKX1CVKh3d/sziWSvTSEriRjGz17UtRyOWFUvVEhsfmGrCon/kT7me WxjnWLv2/iKzd0PjmM9wLFX2NXeHt7vDQtfbKyIfHn7muZXXf4zH24GMGfKsCNp9iQ5x hV+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=uGakVfnUHTotaBa8u50t+RuW90jXuEMteJbj2e6oUjA=; b=ryRKWxyeD7WsykUab84vIINGshQzpXylifqnuk/lj8iE2JimKFYDQMBry3fPZwdmeu IVgEohswj584zibXZQtVYsFqSKucuEfAv1HWafL8R0oGr8wCmYjKmcWHigNQubNxOZpT CuQ5AMgkUy+xK8My0ZHuBrAef6C2Fj1UZFG7o6UDiP3zMaO8UZXc70tbeoUl1pH3uXTG 76wNNBdver06UQGb7XvJvfu2e9op0LsXeF9vB94MAS1mGk3/CnX89xsDzarxiKDiBv4r t/pVv0lS/4O1QxwUulFgMpObG7IQQuN1bBbah0Lz/4KC+R/rtfiCmEdKNP0O9SgwV/mB SW8A== X-Gm-Message-State: AOAM530lAxZSZbVA4MQfk/zrYsrQdoui928Re6zO0GjhuLaEEtxWrtWx N/P/mGkOo4Ru1xEYdwnInuE34XTHnz6CUM2ZfOA= X-Received: by 2002:a05:6402:1516:: with SMTP id f22mr25931013edw.382.1607973934534; Mon, 14 Dec 2020 11:25:34 -0800 (PST) MIME-Version: 1.0 References: <20201127113405.26867-1-jack@suse.cz> <20201127113405.26867-10-jack@suse.cz> In-Reply-To: <20201127113405.26867-10-jack@suse.cz> From: harshad shirwadkar Date: Mon, 14 Dec 2020 11:25:23 -0800 Message-ID: Subject: Re: [PATCH 09/12] ext4: Drop sync argument of ext4_commit_super() To: Jan Kara Cc: Ted Tso , Ext4 Developers List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Looks good to me. Reviewed-by: Harshad Shirwadkar On Fri, Nov 27, 2020 at 10:25 AM Jan Kara wrote: > > Everybody passes 1 as sync argument of ext4_commit_super(). Just drop > it. > > Signed-off-by: Jan Kara > --- > fs/ext4/super.c | 47 ++++++++++++++++++++++------------------------- > 1 file changed, 22 insertions(+), 25 deletions(-) > > diff --git a/fs/ext4/super.c b/fs/ext4/super.c > index 73a09b73fc11..aae12ea1466a 100644 > --- a/fs/ext4/super.c > +++ b/fs/ext4/super.c > @@ -65,7 +65,7 @@ static struct ratelimit_state ext4_mount_msg_ratelimit; > static int ext4_load_journal(struct super_block *, struct ext4_super_block *, > unsigned long journal_devnum); > static int ext4_show_options(struct seq_file *seq, struct dentry *root); > -static int ext4_commit_super(struct super_block *sb, int sync); > +static int ext4_commit_super(struct super_block *sb); > static int ext4_mark_recovery_complete(struct super_block *sb, > struct ext4_super_block *es); > static int ext4_clear_journal_err(struct super_block *sb, > @@ -621,7 +621,7 @@ static void save_error_info(struct super_block *sb, int error, > { > __save_error_info(sb, error, ino, block, func, line); > if (!bdev_read_only(sb->s_bdev)) > - ext4_commit_super(sb, 1); > + ext4_commit_super(sb); > } > > /* Deal with the reporting of failure conditions on a filesystem such as > @@ -686,7 +686,7 @@ static void flush_stashed_error_work(struct work_struct *work) > struct ext4_sb_info *sbi = container_of(work, struct ext4_sb_info, > s_error_work); > > - ext4_commit_super(sbi->s_sb, 1); > + ext4_commit_super(sbi->s_sb); > } > > #define ext4_error_ratelimit(sb) \ > @@ -1151,7 +1151,7 @@ static void ext4_put_super(struct super_block *sb) > es->s_state = cpu_to_le16(sbi->s_mount_state); > } > if (!sb_rdonly(sb)) > - ext4_commit_super(sb, 1); > + ext4_commit_super(sb); > > rcu_read_lock(); > group_desc = rcu_dereference(sbi->s_group_desc); > @@ -2641,7 +2641,7 @@ static int ext4_setup_super(struct super_block *sb, struct ext4_super_block *es, > if (sbi->s_journal) > ext4_set_feature_journal_needs_recovery(sb); > > - err = ext4_commit_super(sb, 1); > + err = ext4_commit_super(sb); > done: > if (test_opt(sb, DEBUG)) > printk(KERN_INFO "[EXT4 FS bs=%lu, gc=%u, " > @@ -4862,7 +4862,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) > if (DUMMY_ENCRYPTION_ENABLED(sbi) && !sb_rdonly(sb) && > !ext4_has_feature_encrypt(sb)) { > ext4_set_feature_encrypt(sb); > - ext4_commit_super(sb, 1); > + ext4_commit_super(sb); > } > > /* > @@ -5415,7 +5415,7 @@ static int ext4_load_journal(struct super_block *sb, > es->s_journal_dev = cpu_to_le32(journal_devnum); > > /* Make sure we flush the recovery flag to disk. */ > - ext4_commit_super(sb, 1); > + ext4_commit_super(sb); > } > > return 0; > @@ -5425,7 +5425,7 @@ static int ext4_load_journal(struct super_block *sb, > return err; > } > > -static int ext4_commit_super(struct super_block *sb, int sync) > +static int ext4_commit_super(struct super_block *sb) > { > struct ext4_sb_info *sbi = EXT4_SB(sb); > struct ext4_super_block *es = EXT4_SB(sb)->s_es; > @@ -5502,8 +5502,7 @@ static int ext4_commit_super(struct super_block *sb, int sync) > > BUFFER_TRACE(sbh, "marking dirty"); > ext4_superblock_csum_set(sb); > - if (sync) > - lock_buffer(sbh); > + lock_buffer(sbh); > if (buffer_write_io_error(sbh) || !buffer_uptodate(sbh)) { > /* > * Oh, dear. A previous attempt to write the > @@ -5519,16 +5518,14 @@ static int ext4_commit_super(struct super_block *sb, int sync) > set_buffer_uptodate(sbh); > } > mark_buffer_dirty(sbh); > - if (sync) { > - unlock_buffer(sbh); > - error = __sync_dirty_buffer(sbh, > - REQ_SYNC | (test_opt(sb, BARRIER) ? REQ_FUA : 0)); > - if (buffer_write_io_error(sbh)) { > - ext4_msg(sb, KERN_ERR, "I/O error while writing " > - "superblock"); > - clear_buffer_write_io_error(sbh); > - set_buffer_uptodate(sbh); > - } > + unlock_buffer(sbh); > + error = __sync_dirty_buffer(sbh, > + REQ_SYNC | (test_opt(sb, BARRIER) ? REQ_FUA : 0)); > + if (buffer_write_io_error(sbh)) { > + ext4_msg(sb, KERN_ERR, "I/O error while writing " > + "superblock"); > + clear_buffer_write_io_error(sbh); > + set_buffer_uptodate(sbh); > } > return error; > } > @@ -5559,7 +5556,7 @@ static int ext4_mark_recovery_complete(struct super_block *sb, > > if (ext4_has_feature_journal_needs_recovery(sb) && sb_rdonly(sb)) { > ext4_clear_feature_journal_needs_recovery(sb); > - ext4_commit_super(sb, 1); > + ext4_commit_super(sb); > } > out: > jbd2_journal_unlock_updates(journal); > @@ -5601,7 +5598,7 @@ static int ext4_clear_journal_err(struct super_block *sb, > > EXT4_SB(sb)->s_mount_state |= EXT4_ERROR_FS; > es->s_state |= cpu_to_le16(EXT4_ERROR_FS); > - ext4_commit_super(sb, 1); > + ext4_commit_super(sb); > > jbd2_journal_clear_err(journal); > jbd2_journal_update_sb_errno(journal); > @@ -5703,7 +5700,7 @@ static int ext4_freeze(struct super_block *sb) > ext4_clear_feature_journal_needs_recovery(sb); > } > > - error = ext4_commit_super(sb, 1); > + error = ext4_commit_super(sb); > out: > if (journal) > /* we rely on upper layer to stop further updates */ > @@ -5725,7 +5722,7 @@ static int ext4_unfreeze(struct super_block *sb) > ext4_set_feature_journal_needs_recovery(sb); > } > > - ext4_commit_super(sb, 1); > + ext4_commit_super(sb); > return 0; > } > > @@ -5985,7 +5982,7 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data) > } > > if (sbi->s_journal == NULL && !(old_sb_flags & SB_RDONLY)) { > - err = ext4_commit_super(sb, 1); > + err = ext4_commit_super(sb); > if (err) > goto restore_opts; > } > -- > 2.16.4 >