Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp2199173lqo; Sun, 19 May 2024 19:23:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUq/sLsHvUoe2+hdjg4g82bOAZoPvy3H/pjH/28tCIoXNJvoG2k2uIK8PE/5JoUXNeShfyUxCxfJPcnVvXzvynaBYVXFzDwZuNQz2JG0w== X-Google-Smtp-Source: AGHT+IHhkSZ11ozGxQrKKaz7Fb/b85lGJLb0mxC6iHKa/V54SdWD4fl4GvMr4z5FcH+Kih8HXtxZ X-Received: by 2002:a50:cd46:0:b0:574:eb43:3863 with SMTP id 4fb4d7f45d1cf-574eb4339c5mr13265977a12.27.1716171819246; Sun, 19 May 2024 19:23:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716171819; cv=pass; d=google.com; s=arc-20160816; b=eF4ishw+ibiwOBJZjcIeUMv4WAy/qx+NtR+4lfiklNdUU8n+mPjU5GZI7L6b9sy47i iOlD7Wg6yQA9YHW+prQujxwJcw9TKP+BJ16SctJpqTWejGthfsHB8fwt+lPTZJ7wPUow ewyGZcrZUy0EqnS4Mwi5UsCxvTkF6prWXDUp9cS1Bg5pea3k6ZHyjHkZbGnlRaOs88eC 0RH/5XR+78XyYAeNy8qorKtx3KzbpTY1D2hQ8bttIVd2p7eNwispNSrDajb/fTypiT13 nGjE829Ci8Rl33IEabym7zmmLX+81pbOgFFpLndEu0YG8iE5qWSgU5vxHvAOXDWBQrSw IlIg== 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:subject :user-agent:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:date:message-id:dkim-signature; bh=ytlcCUx8NfcUiSo9PNtjhqXUj4OMWJVp78FGSlWTWKA=; fh=+pegVmHDK94zlEjj6Xvli0jIeEH4D6+NJP9ZZwH1bQI=; b=jnf+hY4MSCTej4EE03MAyj/nq9oatdqb6dIKnvD1UxVRWbkezr+NgOo0D4Jv3pBbJO eCKaJJlFkNxDBRrQGhngRX9DpoIVCjN1+vAgmhGbLQa6iVVeXsXdaY9xb8UKwrevqBg4 a5y+FJHgrRnJA1+doYvTmD4ZIV+lWL66DlasXZyntPAZqPV69rHnB/ox6KgiyHNtXQZ7 xZvz89l9tBbfFJfbUz73wuCPTM3tPqbjZN3c5qcsHMiauQpp74OUjxBlywGEWosh3MsN 6HLi3P3eVKRu6vGIt9mDUm2aatXt2xD8PjjNIetetc4JJ8UIxDJ/G4DPactMpS1KN3fx C5BQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.alibaba.com header.s=default header.b=eIaUpmR2; arc=pass (i=1 spf=pass spfdomain=linux.alibaba.com dkim=pass dkdomain=linux.alibaba.com dmarc=pass fromdomain=linux.alibaba.com); spf=pass (google.com: domain of linux-kernel+bounces-183357-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183357-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.alibaba.com 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-5733c36d53asi12595462a12.530.2024.05.19.19.23.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 May 2024 19:23:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-183357-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; dkim=pass header.i=@linux.alibaba.com header.s=default header.b=eIaUpmR2; arc=pass (i=1 spf=pass spfdomain=linux.alibaba.com dkim=pass dkdomain=linux.alibaba.com dmarc=pass fromdomain=linux.alibaba.com); spf=pass (google.com: domain of linux-kernel+bounces-183357-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183357-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.alibaba.com 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 0124E1F22134 for ; Mon, 20 May 2024 02:23:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6058DC8CE; Mon, 20 May 2024 02:23:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="eIaUpmR2" Received: from out30-118.freemail.mail.aliyun.com (out30-118.freemail.mail.aliyun.com [115.124.30.118]) (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 4F9FDFBF6; Mon, 20 May 2024 02:23:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.118 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716171810; cv=none; b=Gsw+6VCGhJrb97UuU5ACtluiJwgfmxi+kFR6KvuoBfWXQxtlfBPiHpWZRISgIoN7xsfm/mX8oPL0xTzvKwFpWcRPzULTwZ8BTqZ6q3a8E8GsLYbuqw7PURuU5ZAOoStS3O72Tg4zdycOY07Z+KP6C+cpTlt8ONRvaWNsTe5I0WE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716171810; c=relaxed/simple; bh=njWqcNmwlWZ3UnC83e7dXn6VIIIQZA+GOMTX4QtwrBo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=iyYR8DyhAESrRb5kvJlaS4CyWv/sf25ymAXpaIlz1LVY1F8jgXK3o+A/Pc/JxtA3zI/5WtaSaY13r7upTYLebXT5OVyhBO7IDmJF/xinE5XVBsno2y2v240MLOwowNtKG2RqXIPHTRSANyzpbqX8VC3kKs6etarWtM7BXroHE94= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=eIaUpmR2; arc=none smtp.client-ip=115.124.30.118 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1716171805; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=ytlcCUx8NfcUiSo9PNtjhqXUj4OMWJVp78FGSlWTWKA=; b=eIaUpmR2IaRoK+euSg8uue/7AO/p0/wq0vzvoIi3qO5orokZcA64hQ9QEfe5j8hPNGESFYbbFd/ZsZHjOUkiIAPo5Lr1E5QVSN4Ua8Ppdye7bXw7q0HZj79PitqBt7v3IR6naYljEyFib0hDws/ezUx8XucpsDSbsXXpbWVyZ6I= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R931e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033045046011;MF=hsiangkao@linux.alibaba.com;NM=1;PH=DS;RN=14;SR=0;TI=SMTPD_---0W6kn7oV_1716171803; Received: from 30.97.48.204(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0W6kn7oV_1716171803) by smtp.aliyun-inc.com; Mon, 20 May 2024 10:23:24 +0800 Message-ID: <38b601b0-6a6d-4465-9137-85a59c6c2c71@linux.alibaba.com> Date: Mon, 20 May 2024 10:23:21 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 02/12] cachefiles: remove err_put_fd tag in cachefiles_ondemand_daemon_read() To: libaokun@huaweicloud.com, 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 References: <20240515084601.3240503-1-libaokun@huaweicloud.com> <20240515084601.3240503-3-libaokun@huaweicloud.com> From: Gao Xiang In-Reply-To: <20240515084601.3240503-3-libaokun@huaweicloud.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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") > readable. > > Signed-off-by: Baokun Li > Reviewed-by: Jia Zhu Reviewed-by: Gao Xiang Thanks, Gao Xiang > --- > 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;