Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp312310pxj; Thu, 10 Jun 2021 23:09:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJOoEhR4ESS2vpj/2c/ADfj9W+NdMvW207+DtMeELsiZ0BxUrovKBpGixmSWDd5YzsRABj X-Received: by 2002:a17:906:48c8:: with SMTP id d8mr2173654ejt.176.1623391787232; Thu, 10 Jun 2021 23:09:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623391787; cv=none; d=google.com; s=arc-20160816; b=uJOWb0O5H76+EfSe3k6mb8eiHOBAmn+s40HeBemGTlnTRexdPfU3maNuxyj2r0Sggt rUIPca6k7UCzzzeVp1mP0aT5QckGd9LREnry9azQ9IM346mtBjaISxxHYf973/U+l0sL J1ZbaX6AHfCWn0sIUCgnSLayRrbZKVn5G+KK5gty8XvPq5MO8qFamugiE2Z77qm5dQHQ 3HLd7c3fQv1k6chEIlxxYTQgmfG1WY6tv0eyHm7ZHP2cxnX+96Ho7XWMlVCMUs0B+biF j71kW9DuF3DGzuwnfRWKlYZSZj8NE6xboa++VIurdwPGjz9ViVZpCI1EF5C2v5WFjVta DsLw== 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:to:subject; bh=z4daBC/D0QXNYeyB4y3+muINQmuFu9kK6fILUEGMWds=; b=wCxzzBTHLrGkFUUB6WvwLmv5OLrk21GcJAF71XC59Lj1HHQnz40b9RL1V/Gcj/0qg+ 8vDKSHlXtMfgbwbJjMRBGYnA8hPZbNOiX6WicUDzFBUem0bSdy2jSBpiCEWD1RkHqwUh 0bmJmDmY4b+PtVIgj2TLN101N1jl3RvxhplLVV4o1RRm1dZ5WGLfdswzEE95m+EyvYux 5da59/NcIgrnXsBGfgZU29iNIFtZeP6nkblD/Xrz3Nei8yqnj/WPLkkpnjXlWUfmI+gp TzU82222082RHNGqtEm0qEQoOg75o+RYQOsF+CpkG8ev73UoMG/Za1xc8zQmBW6mNTTU GZOw== 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=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id eb13si4779873edb.182.2021.06.10.23.09.24; Thu, 10 Jun 2021 23:09:47 -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=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231193AbhFKGIB (ORCPT + 99 others); Fri, 11 Jun 2021 02:08:01 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:5501 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230251AbhFKGIA (ORCPT ); Fri, 11 Jun 2021 02:08:00 -0400 Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4G1Vd92BwlzZf3v; Fri, 11 Jun 2021 14:03:09 +0800 (CST) Received: from dggpeml500020.china.huawei.com (7.185.36.88) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 11 Jun 2021 14:06:00 +0800 Received: from [10.174.177.174] (10.174.177.174) by dggpeml500020.china.huawei.com (7.185.36.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 11 Jun 2021 14:05:59 +0800 Subject: Re: [PATCH -next] btrfs: send: use list_move_tail instead of list_del/list_add_tail To: , Anand Jain , , Chris Mason , Josef Bacik , David Sterba , , , , , , , Hulk Robot References: <20210608031220.2822257-1-libaokun1@huawei.com> <20210608141233.GQ31483@twin.jikos.cz> From: "libaokun (A)" Message-ID: Date: Fri, 11 Jun 2021 14:05:53 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 MIME-Version: 1.0 In-Reply-To: <20210608141233.GQ31483@twin.jikos.cz> Content-Type: text/plain; charset="gbk"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.177.174] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpeml500020.china.huawei.com (7.185.36.88) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thank you for your advice. I'm about to send a patch v2 with the changes suggested by you. Best Regards ?? 2021/6/8 22:12, David Sterba ะด??: > On Tue, Jun 08, 2021 at 01:16:21PM +0800, Anand Jain wrote: >> On 8/6/21 11:12 am, Baokun Li wrote: >>> Using list_move_tail() instead of list_del() + list_add_tail(). >>> >>> Reported-by: Hulk Robot >>> Signed-off-by: Baokun Li >>> --- >>> fs/btrfs/send.c | 3 +-- >>> 1 file changed, 1 insertion(+), 2 deletions(-) >>> >>> diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c >>> index bd69db72acc5..a0e51b2416a1 100644 >>> --- a/fs/btrfs/send.c >>> +++ b/fs/btrfs/send.c >>> @@ -2083,8 +2083,7 @@ static struct name_cache_entry *name_cache_search(struct send_ctx *sctx, >>> */ >>> static void name_cache_used(struct send_ctx *sctx, struct name_cache_entry *nce) >>> { >>> - list_del(&nce->list); >>> - list_add_tail(&nce->list, &sctx->name_cache_list); >>> + list_move_tail(&nce->list, &sctx->name_cache_list); >>> } >> >> Looks good. >> You can consider open-code name_cache_used() as there is only one user. > Yeah sounds like a good idea, with part of the function comment next to > the list_move_tail. > .