Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp2637188pxy; Sat, 24 Apr 2021 23:21:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxYkkr2eXBvujzE/BfBGJttRg11tLo3OkXDS/F9bCsAPAskEu7laMhOvN9XkAa4ahUBo5O4 X-Received: by 2002:a17:90b:88f:: with SMTP id bj15mr15092915pjb.147.1619331690350; Sat, 24 Apr 2021 23:21:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619331690; cv=none; d=google.com; s=arc-20160816; b=dRQflilQImIRk/ir5gBcz6eyLAmy6Nb/KXJu3qU5Baz4OSNKXji4GDUvvgi544eSG9 /Eb+RZbSos25FtN4eVKoUESMeepHBtNmkxM6f+lm3S/i4WYr1TVEV1b06ZP5fMhO/TVM 7YqB/w+ELuFx38n+CYlsPmCJWS+0fnT/tuGqxbskc2/QoJdEkclTe2C1pzarZsYz1wVg N+XFSrhzBTfExqzLk3ENWfqcRB1UcpL0UpVD1jZydf6PMXeyAFhoZ1Wx1+9B6eQFSiUA HsbWK1uYcqqriaFoIhdWtEtygAzwk8x4DBcdBsQOxY31hBVHcKrj4gtSOINP+uwG8IYG Apkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=OSdWbiXr5J5vjAajCbkxTOPGkiP+DUvLQDZROUz/Ins=; b=mpyMWCjZ2NqEwr9mjaOhnWnZbfvKUzbqgzyiFnSy+gB4ZjlOqH0fIsiwMp4RBfwEMJ 6paCaJzbtYom220vc0y071tfCWMG5O3R5OcpikVUd2VP8wKAxANg2GJ2J9/0M6ARrSkw JncmMscbMmkjLfHIWTWUs4Wa17U9b72jPSTAUXGQwtva7K4NJXfPfx9gAtZRlQ+JV4cB GN6eYq9XvvwJDsPK0HRE+M9dSG37GlOQO2BPvOLV2Y4LWHfChTT7KYjNTZY/CBfcw+2Y HVFxO91OUz+uMvMXirKC1xJ6wvB2bJFbd8WnK+5K0w8ICABNGFG0cxsqyH84tyTX/6jN dF/Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id in16si16075736pjb.30.2021.04.24.23.21.17; Sat, 24 Apr 2021 23:21:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229610AbhDYGVY (ORCPT + 99 others); Sun, 25 Apr 2021 02:21:24 -0400 Received: from out30-133.freemail.mail.aliyun.com ([115.124.30.133]:47968 "EHLO out30-133.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229522AbhDYGVY (ORCPT ); Sun, 25 Apr 2021 02:21:24 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R101e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04420;MF=joseph.qi@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0UWeubQZ_1619331642; Received: from B-D1K7ML85-0059.local(mailfrom:joseph.qi@linux.alibaba.com fp:SMTPD_---0UWeubQZ_1619331642) by smtp.aliyun-inc.com(127.0.0.1); Sun, 25 Apr 2021 14:20:42 +0800 Subject: Re: [PATCH] ocfs2: Remove repeated uptodate check for buffer To: Wan Jiabing , Mark Fasheh , Joel Becker , ocfs2-devel@oss.oracle.com, linux-kernel@vger.kernel.org, akpm Cc: kael_w@yeah.net References: <20210425025702.13628-1-wanjiabing@vivo.com> From: Joseph Qi Message-ID: Date: Sun, 25 Apr 2021 14:20:42 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 MIME-Version: 1.0 In-Reply-To: <20210425025702.13628-1-wanjiabing@vivo.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/25/21 10:57 AM, Wan Jiabing wrote: > In commit 60f91826ca62 ("buffer: Avoid setting buffer bits that are > already set"), function set_buffer_##name was added a test_bit() to > check buffer, which is the same as function buffer_##name. > The !buffer_uptodate(bh) here is a repeated check. Remove it. > > Signed-off-by: Wan Jiabing Looks good. Reviewed-by: Joseph Qi > --- > fs/ocfs2/aops.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c > index ad20403b383f..bd039fdbb27e 100644 > --- a/fs/ocfs2/aops.c > +++ b/fs/ocfs2/aops.c > @@ -634,8 +634,7 @@ int ocfs2_map_page_blocks(struct page *page, u64 *p_blkno, > } > > if (PageUptodate(page)) { > - if (!buffer_uptodate(bh)) > - set_buffer_uptodate(bh); > + set_buffer_uptodate(bh); > } else if (!buffer_uptodate(bh) && !buffer_delay(bh) && > !buffer_new(bh) && > ocfs2_should_read_blk(inode, page, block_start) && >