From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35FBEC433B4 for ; Fri, 7 May 2021 03:45:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 10DF760FEB for ; Fri, 7 May 2021 03:45:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232900AbhEGDp6 (ORCPT ); Thu, 6 May 2021 23:45:58 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:18362 "EHLO szxga06-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231299AbhEGDp4 (ORCPT ); Thu, 6 May 2021 23:45:56 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4Fbx9M3pGRzlcF3; Fri, 7 May 2021 11:42:47 +0800 (CST) Received: from [10.67.77.175] (10.67.77.175) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.498.0; Fri, 7 May 2021 11:44:45 +0800 Subject: Re: [PATCH] fs/buffer.c: Delete redundant uptodate check for buffer From: Shaokun Zhang To: , CC: Yang Guo , Alexander Viro , Andrew Morton References: <1617260222-13797-1-git-send-email-zhangshaokun@hisilicon.com> Message-ID: <350ff867-d3af-e6b4-0a9a-51981aa431a6@hisilicon.com> Date: Fri, 7 May 2021 11:44:45 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.77.175] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andrew, A gentle ping. Thanks, Shaokun On 2021/4/12 9:54, Shaokun Zhang wrote: > +Cc: Andrew Morton > > On 2021/4/1 14:57, Shaokun Zhang wrote: >> From: Yang Guo >> >> The buffer uptodate state has been checked in function set_buffer_uptodate, >> there is no need use buffer_uptodate before calling set_buffer_uptodate and >> delete it. >> >> Cc: Alexander Viro >> Signed-off-by: Yang Guo >> Signed-off-by: Shaokun Zhang >> --- >> fs/buffer.c | 6 ++---- >> 1 file changed, 2 insertions(+), 4 deletions(-) >> >> diff --git a/fs/buffer.c b/fs/buffer.c >> index 673cfbef9eec..2c0d0b3f3203 100644 >> --- a/fs/buffer.c >> +++ b/fs/buffer.c >> @@ -2055,8 +2055,7 @@ int __block_write_begin_int(struct page *page, loff_t pos, unsigned len, >> block_end = block_start + blocksize; >> if (block_end <= from || block_start >= to) { >> if (PageUptodate(page)) { >> - if (!buffer_uptodate(bh)) >> - set_buffer_uptodate(bh); >> + set_buffer_uptodate(bh); >> } >> continue; >> } >> @@ -2088,8 +2087,7 @@ int __block_write_begin_int(struct page *page, loff_t pos, unsigned len, >> } >> } >> if (PageUptodate(page)) { >> - if (!buffer_uptodate(bh)) >> - set_buffer_uptodate(bh); >> + set_buffer_uptodate(bh); >> continue; >> } >> if (!buffer_uptodate(bh) && !buffer_delay(bh) && >>