Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp2229473lqo; Sun, 19 May 2024 21:15:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUdf8A8QrUGs1LgQgYIgCBe6zzQPUNdYYdpxb3UReJJTicjXSHoIdZE0X9NhYz5yfNuSEV8XBR4HoVkvYPzKqiMHpd4P6KcO8ujjbCklQ== X-Google-Smtp-Source: AGHT+IEGesy/k1ljxWZmc6UzoQeC/iRSPxJ5c9QLVatI0Mr8wDnfCQcVuy9gH+MIoTTqd+RfjIoB X-Received: by 2002:a50:f605:0:b0:56b:ec47:a846 with SMTP id 4fb4d7f45d1cf-5734d5ceb43mr17641937a12.25.1716178552044; Sun, 19 May 2024 21:15:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716178552; cv=pass; d=google.com; s=arc-20160816; b=UeNiUEHp5kIKdN03NTrWAIJI9+uMrkp3qGnEubmnkUowqvn6YSjZSBIM8JGrHpprud badAn9mAlrb5z7gn/bZmVSGlNWwTRkh0EN/lu4eVZg88PrJYI2IiXdTzPUyTVIUHSD/5 +Mqk90vtcvFFYNvNlF/6p2xPVuk0oa7DCjFGHib/n0lZSiFWMXr1kpUk8/ed/igdAah1 fXPIcE2lTwj+tXu16QyIQzOwdvW1csmjuSjBbHx21rhyJIrHCtIVjRPQxfA69K6S45aE Pg0Wy6g/NzF0mL2eBUoI7k/JxsA57P1DrzzG7rzD7kHQ6PzBvrumxTN038LnNcXliqbv au+A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=PcCZGUTMhlMSkOaewE4wqjimgR6VEB6qkRqaYpZNuoU=; fh=sM+Kfidb8V810RmkDwtqlaKt3YUIAEp1lQ7HnJqRVw4=; b=Osj8fY3dLTmqJvTNirkYtq7V4ir2bSo7Id1bd36lPjpC70M6+J7bP4jfcqun8QLOmb vBdTrUHeOYKGaERCu8zecy+HU8WkWTi7FynsmELuXcENbEHWHFS6jM3nWNtH3I3cc23t eZl8Rgmaazp24Ux3L0jLmZCr4pxdnEx4lniq4vjbgEkFRWMUcGeV8Bt0uPExL06dCY6I cbacbxWnqzL/846kqj0Y4BcIuOH8otnXlRXJ8YqczDhECllYIKQE8vkNv42894kgs8Hq 7+zk8fhBzt8Rp4D6uEj5qlC4jnsicorWFUQJmIhq9b+ir0tzjuFm6zVez4tmPJWqwzPa I1oQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-183408-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183408-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5733bec074bsi12923661a12.150.2024.05.19.21.15.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 May 2024 21:15:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-183408-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-183408-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183408-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id C45FC1F21EE0 for ; Mon, 20 May 2024 04:15:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 19BED12E68; Mon, 20 May 2024 04:15:42 +0000 (UTC) Received: from dggsgout12.his.huawei.com (unknown [45.249.212.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AD9683234; Mon, 20 May 2024 04:15:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716178541; cv=none; b=qe2vfX675/8M/YUPQa9fNYiudV98rJfq6xNOmZ/pY6JKvtNv1vQd65MrZbOcS51j/d3uoHerM/qQiaq3s23LA53eQeXyXO1zQy9BfOeikes4Ld3o04vPcpBhfak558Mdy41i4vqn7yy1xtGooRcb4unfbC3ZNwX1QltMvCDPlPk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716178541; c=relaxed/simple; bh=hJmhI5EjoPxQCypdpZ/6pi/NTNvKyFsqAhhSa5OG7/A=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=GF9W2wr0I6u0vTeCzmhTPUZ5VQmlyvecASK7/HwV6qP4aw8p3R5rMQ9/xMFQ27a0rPFa+Q55HYc2gM6S4YrKnDnCtVTuDXPjNb0I/H51WA2iyg7H0JibfkqYEE4n3ZEEMaC+a6+LDTLVEXt5UvWO+egWF5L6eQnpx3ektpLcWdI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com; spf=pass smtp.mailfrom=huaweicloud.com; arc=none smtp.client-ip=45.249.212.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huaweicloud.com Received: from mail.maildlp.com (unknown [172.19.93.142]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4VjPPC2M4zz4f3jrk; Mon, 20 May 2024 12:15:27 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.112]) by mail.maildlp.com (Postfix) with ESMTP id 2F67B1A017F; Mon, 20 May 2024 12:15:36 +0800 (CST) Received: from [10.174.177.174] (unknown [10.174.177.174]) by APP1 (Coremail) with SMTP id cCh0CgAn9g5lzkpmmiWgNA--.60734S3; Mon, 20 May 2024 12:15:35 +0800 (CST) Message-ID: <345904d3-7a71-1956-3ad0-4017ba4eb8b3@huaweicloud.com> Date: Mon, 20 May 2024 12:15:33 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.1.2 Subject: Re: [PATCH v2 02/12] cachefiles: remove err_put_fd tag in cachefiles_ondemand_daemon_read() Content-Language: en-US To: Gao Xiang , netfs@lists.linux.dev, dhowells@redhat.com, jlayton@kernel.org Cc: jefflexu@linux.alibaba.com, zhujia.zj@bytedance.com, linux-erofs@lists.ozlabs.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, yangerkun@huawei.com, houtao1@huawei.com, yukuai3@huawei.com, wozizhi@huawei.com, Baokun Li , libaokun@huaweicloud.com References: <20240515084601.3240503-1-libaokun@huaweicloud.com> <20240515084601.3240503-3-libaokun@huaweicloud.com> <38b601b0-6a6d-4465-9137-85a59c6c2c71@linux.alibaba.com> From: Baokun Li In-Reply-To: <38b601b0-6a6d-4465-9137-85a59c6c2c71@linux.alibaba.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-CM-TRANSID:cCh0CgAn9g5lzkpmmiWgNA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WlDUUUU X-CM-SenderInfo: 5olet0hnxqqx5xdzvxpfor3voofrz/ On 2024/5/20 10:23, Gao Xiang wrote: > > > On 2024/5/15 16:45, libaokun@huaweicloud.com wrote: >> From: Baokun Li >> >> The err_put_fd tag is only used once, so remove it to make the code more > > The err_put_fd label .. > > Also the subject line needs to be updated too.  ("C goto label") > Sorry about that, and thank you very much for the correction! I will correct "tag" to "label" in the next iteration. >> readable. >> >> Signed-off-by: Baokun Li >> Reviewed-by: Jia Zhu > > Reviewed-by: Gao Xiang > > Thanks, > Gao Xiang Thank you very much for your review! Regards, Baokun > >> --- >>   fs/cachefiles/ondemand.c | 7 +++---- >>   1 file changed, 3 insertions(+), 4 deletions(-) >> >> diff --git a/fs/cachefiles/ondemand.c b/fs/cachefiles/ondemand.c >> index 4ba42f1fa3b4..fd49728d8bae 100644 >> --- a/fs/cachefiles/ondemand.c >> +++ b/fs/cachefiles/ondemand.c >> @@ -347,7 +347,9 @@ ssize_t cachefiles_ondemand_daemon_read(struct >> cachefiles_cache *cache, >>         if (copy_to_user(_buffer, msg, n) != 0) { >>           ret = -EFAULT; >> -        goto err_put_fd; >> +        if (msg->opcode == CACHEFILES_OP_OPEN) >> +            close_fd(((struct cachefiles_open *)msg->data)->fd); >> +        goto error; >>       } >>         /* CLOSE request has no reply */ >> @@ -358,9 +360,6 @@ ssize_t cachefiles_ondemand_daemon_read(struct >> cachefiles_cache *cache, >>         return n; >>   -err_put_fd: >> -    if (msg->opcode == CACHEFILES_OP_OPEN) >> -        close_fd(((struct cachefiles_open *)msg->data)->fd); >>   error: >>       xa_erase(&cache->reqs, id); >>       req->error = ret; -- With Best Regards, Baokun Li