Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2455144pxj; Mon, 17 May 2021 01:46:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwBoavv51O/+bBpsLvmalnpNGy5D1/zZoCrKGurDce/zrbE+J5sR3REfI7xT5pZilF/7K3p X-Received: by 2002:a05:6402:26d6:: with SMTP id x22mr45130343edd.88.1621241178344; Mon, 17 May 2021 01:46:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621241178; cv=none; d=google.com; s=arc-20160816; b=hEFr13c0oZbBfmBda8ODSUs8Io5wbLaslMkkl7QI7o9YM+6Tx+7RvmuFaD/WWYjnx/ Yyrlz7cZRcBPCmg3bTx5Vgav6Glyy7pqoESDgnKYWWOpr+b9fv/FQw6MxSDigGSwHT4M /Qbj4IsCI2h+U9YV/u6cxWat/pcyQ7FYuZQp4SyJqYzgYEa73CyE1Vr4GN0jofSyfzeP 4XXVF8DAinhavLk63pIoIOwArTx6gLIg0NRec9NLKnq8iLJ+smOEGAAmcpAbtEgKhnJZ 6vpziZvxjhsxt+seT6djfKVAMOKcXXPJL6Y2bOi8rEEd8npOo9h/QW6qmgjMDFeKct4A +UUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=XqA8+JCKRvRQ0y9TJ9pOGinpDoGfkI05PSjR98ORGQM=; b=aKBxrSOvAkt1qnj9JtIKDfsHAa9XJjiqmZoKQaLiFRdIEmHCh+Pxbmrzo5L42bTG6W 5pm4rIXlHAGNI5+fQWtYj2yI493q+ns97p3AE4lx0Qdapmo3M4qRO4JiAmhyjtLjllc9 yI0jvGlFTWEMB87qtUyVnAwnHsI1qZTwXbCrDRYgHFzEVzE/BI1UOdCLCMiSQ2FQwPMy v8DqF3GzP3x6nDYBRPM32JAFeQPOoyhF3EW3hY+JVg3bs9bd4Hkw3kNEfHLZsbe6sJ0+ Wefsz1QT1LFIiZk9YcvyR1MPg/Bp44cdKjYpE6xdTnC5kzzC2h7m4PdxqC6g6D7vY6Fp T7zw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d12si15643872ejj.296.2021.05.17.01.45.51; Mon, 17 May 2021 01:46:18 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235521AbhEQIpk (ORCPT + 99 others); Mon, 17 May 2021 04:45:40 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:3006 "EHLO szxga06-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235571AbhEQIpi (ORCPT ); Mon, 17 May 2021 04:45:38 -0400 Received: from dggems706-chm.china.huawei.com (unknown [172.30.72.60]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4FkCL63WLxzmVbj; Mon, 17 May 2021 16:42:06 +0800 (CST) Received: from dggeme759-chm.china.huawei.com (10.3.19.105) by dggems706-chm.china.huawei.com (10.3.19.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2176.2; Mon, 17 May 2021 16:44:19 +0800 Received: from [127.0.0.1] (10.40.188.144) by dggeme759-chm.china.huawei.com (10.3.19.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Mon, 17 May 2021 16:44:19 +0800 Subject: Re: [PATCH] ext4: remove set but rewrite variables To: =?UTF-8?B?0JHQu9Cw0LPQvtC00LDRgNC10L3QutC+INCQ0YDRgtGR0Lw=?= , Tian Tao CC: "Theodore Y. Ts'o" , , References: <1621220165-11849-1-git-send-email-tiantao6@hisilicon.com> From: "tiantao (H)" Message-ID: Date: Mon, 17 May 2021 16:44:18 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.40.188.144] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggeme759-chm.china.huawei.com (10.3.19.105) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org 在 2021/5/17 16:05, Благодаренко Артём 写道: > >> On 17 May 2021, at 05:56, Tian Tao wrote: >> >> In line 2500 of the ext4_dx_add_entry function, the at variable is >> assigned but not used, and it is reassigned in line 2449, so delete >> the assignment of the at variable in line 2500. >> >> Signed-off-by: Tian Tao >> --- >> fs/ext4/namei.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c >> index afb9d05..18bbf15 100644 >> --- a/fs/ext4/namei.c >> +++ b/fs/ext4/namei.c >> @@ -2497,7 +2497,7 @@ static int ext4_dx_add_entry(handle_t *handle, struct ext4_filename *fname, >> >> /* Which index block gets the new entry? */ >> if (at - entries >= icount1) { >> - frame->at = at = at - entries - icount1 + entries2; >> + frame->at = at - entries - icount1 + entries2; >> frame->entries = entries = entries2; >> swap(frame->bh, bh2); >> } >> -- >> 2.7.4 >> > > Hello Tian, > > Thank you for the patch. > > Please, clarify, do you think the logic not changed after you patch if "while (frame > frames) {“ loop is not executed or terminated by “break:” in " if (dx_get_count((frame - 1)->entries) < ...“ block? yes, it's reported by svace. and I check the code it's not change the logic. myabe I was wrong:-P > Also I am not sure code lines numbers in the description are useful for future readers, because they can be changed. I can update the commit message at v2. > > Thank you.. >