Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp838068lqd; Wed, 24 Apr 2024 20:18:12 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUWRe5ScUTlCPBuXHS5ZgZYpxxhH6Vf+lOYyPtHFe6VzOUmo8DfJmSI2qTf339Jhe8IEwTFoeaOR4yTlTfPRQ5iFg8UGSNjlGgWeboCjg== X-Google-Smtp-Source: AGHT+IF2LnjCBTCabgTz5+0kpibMx5qBSLMACCw1Lhs9ENyXxyfubWAzA/w9vzPSpjvP4LS3YX7Y X-Received: by 2002:a05:690c:ecf:b0:61b:1d8d:8c11 with SMTP id cs15-20020a05690c0ecf00b0061b1d8d8c11mr5165699ywb.4.1714015091786; Wed, 24 Apr 2024 20:18:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714015091; cv=pass; d=google.com; s=arc-20160816; b=DtvIQDphO0ancIeT5vQPSqo3GSwNB05UtnGjto+DDUrpFSaqpshfAqqV0l01F03E8J q+9x4LaJPIylprt/JHF09jDiXnQQAqmeqA8r1a6e3vK+k9xK/5F3dzDElblJoaWxxxtI KKcVujiJFPMn3NTRNqAnuxmyuco+X3iKSbk+L6TpVc+5FYMkLvS8uxnKlAm9hDP7rBD5 X9+lqQc+jY6VAjsWBQqrU7yl2kcOHl18L+oSSMO8/YvroypzHPUjVPruS+GCknwcVDRw dTiewX4jMMoRZwrSd1XhOibl2D6Dc7U5C7YTrkN8gDkyEwFxVzmm/R6bHMIotnoDbxf9 xUJg== 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=rDC6+MkZwtTiyGD4zhDwbs6EKw+Azk2OsJsJxDq9WIg=; fh=0xSiBUpPWS3InSKlMb7gDy0GlLcpMzscjAqFtQ0e2YA=; b=uEYkbqLCygBAM0eNbwc5EM8UhyydC5bZrlfjQeK9+7u6FiurJf7GNN0la9eIZnaksc Mtxt7f5fWj5YNfY4eJKSWKcaP1PYdWzR3ZjK3y0EEDLCY8doGZ3Zw+7RUHCHB81oPWkw YPvRCRj56jHkoTHhMJfS5y3Hf8fNbX5jGe8ZpnWRTK82rXhDhPQRA/+DZda8GqI3DHmH im3xhTzI6B/eO6SYZFiKchfGbtJeYeGTRV4zUqSlSICifRmgGGPRyCvthPWcbcsnCMR6 Xa5EiwLoqKwNkPDB4uY2V/ryOpOz2i8EqqTpXqzjJRjdPmBErMt5M2BZdk0rg1UmspWn rWNA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=P16Apjv7; arc=pass (i=1 spf=pass spfdomain=bytedance.com dkim=pass dkdomain=bytedance.com dmarc=pass fromdomain=bytedance.com); spf=pass (google.com: domain of linux-kernel+bounces-157959-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157959-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id y34-20020a634962000000b005e468bd4cadsi12847146pgk.787.2024.04.24.20.18.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 20:18:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-157959-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=P16Apjv7; arc=pass (i=1 spf=pass spfdomain=bytedance.com dkim=pass dkdomain=bytedance.com dmarc=pass fromdomain=bytedance.com); spf=pass (google.com: domain of linux-kernel+bounces-157959-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157959-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 87E0F282F38 for ; Thu, 25 Apr 2024 03:17:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E9CD51DDEE; Thu, 25 Apr 2024 03:17:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b="P16Apjv7" Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DE54C1946F for ; Thu, 25 Apr 2024 03:17:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714015036; cv=none; b=iXEL3VWiBfFZkXrzyWmli0hDfD/DgkesUrJM8q2ZApYcZMtxeOCIkv0eUOnssHziVEuu7N2YM3Xo5xDVvowlcusLFAb09LakNavf17eean+L7J5JPARBb9zTMoUROaoSrGCuMp2l9wbVER4Pmy1O/QeI5IqNpq/mQ0bleL5EvRE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714015036; c=relaxed/simple; bh=pL8OHOWHZcsyFmPcEjc+fBoaOnXJeZNW3DcIFx6MFus=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=asjMZqGgir/TKpDaeRTkk70AcYskwbcAJemN153Fm3ryx0dd01XmFavANZm1WiD502upHWKqtCmI7nTtMOsUgw2AFsr9kbQfKVl2qykQeDO5OgwFRTK2xHE1DcAV9484FC7ELmgqWxp0RyuI4BNFB4NolREge/QR7gedl/geIiM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com; spf=pass smtp.mailfrom=bytedance.com; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b=P16Apjv7; arc=none smtp.client-ip=209.85.210.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bytedance.com Received: by mail-pf1-f175.google.com with SMTP id d2e1a72fcca58-6f074520c8cso627200b3a.0 for ; Wed, 24 Apr 2024 20:17:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1714015034; x=1714619834; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=rDC6+MkZwtTiyGD4zhDwbs6EKw+Azk2OsJsJxDq9WIg=; b=P16Apjv79ZDKsMeWquK73sSlQg9s8QgWLu0QI/QT0qP8hoMn3Ji5qdzct0Y170RN0V dgBiOxTGZdWGB8Lkm0xtrFNI2fmUm44Q5s/H1Hmh6mSReBjB0U8t1Ix7ZFGiRzyHhYrR /92FG/iQFHLe6Rv4CLdyn26CHZ18sVGZJxlqvcLni8JrDaqLdurYOLMCawMgvaLqUcj7 ce2F0rYK5nXlSgxyMEouxx9KXOqPDJqqmvkTzyODyqu92RIJWwIw6fn4P+rDU5pK9dUl RoJyZd2c4ogQNrQS5aYBSoxwITj7rV9ZsrshAgAemNbrV3qamH2UYfwz4Yldb0B5Kr2z F/jQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714015034; x=1714619834; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=rDC6+MkZwtTiyGD4zhDwbs6EKw+Azk2OsJsJxDq9WIg=; b=hXEiTmNToS1tWme9KdDsDiUGzMncSR0zkjQbmk25bKoIemaiCPYwXOznegaBwKCidV PFb/8YZYTiLrRKAqqXY+tQka3lWi+XhyuKm8IqyinAwiU3PDHB9R+/cx5OQ7Q1Miw30o ngCULKTBV94HPQ+z3FiZfdcVhongyvJj3vYq34P8DGOxXO2LeVZKtic4frE6TNLfmSI0 kBYWQ1xcy/KljhAp2jukzTFrIwjnB3FGgOG+xRFsBTShJVWbKfBmIZOcD1vTAq5JHxJW HlKEyvfOicaBVvhBX2QelT/pGHd1ih0MBmMVYuRr9i2VTq77gR4BCL5u08V/VnYuSLGe ZAaA== X-Forwarded-Encrypted: i=1; AJvYcCU8dTLrMuwE7atRIMNO4p2czEF5PAAQ+VfMbk2N+ic7+fWmrI2EsKJpu0BMnrSKsl8K+7Tnszg0EqL2J0Rumjo+WPPgXl2OSS6a+cfx X-Gm-Message-State: AOJu0YygTaia2smquMygwjfDIPEB9Ulromlb3doZG4lNrDPXV4ryukaX onxLiUzQnFJRYSGrJxo+VzHpXGZU22y84raNI+Vb+DwD3bASswSEsmoMxeeI2Nk= X-Received: by 2002:a05:6a21:3d89:b0:1ac:dead:1370 with SMTP id bj9-20020a056a213d8900b001acdead1370mr4849697pzc.21.1714015034157; Wed, 24 Apr 2024 20:17:14 -0700 (PDT) Received: from [10.3.132.118] ([61.213.176.12]) by smtp.gmail.com with ESMTPSA id x23-20020a056a00189700b006edadf8058asm12160586pfh.23.2024.04.24.20.17.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 24 Apr 2024 20:17:13 -0700 (PDT) Message-ID: <9228a873-8250-4b63-bf75-473e9a87ab80@bytedance.com> Date: Thu, 25 Apr 2024 11:17:08 +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 02/12] cachefiles: remove err_put_fd tag in cachefiles_ondemand_daemon_read() To: libaokun@huaweicloud.com, netfs@lists.linux.dev Cc: dhowells@redhat.com, jlayton@kernel.org, jefflexu@linux.alibaba.com, linux-erofs@lists.ozlabs.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Baokun Li References: <20240424033916.2748488-1-libaokun@huaweicloud.com> <20240424033916.2748488-3-libaokun@huaweicloud.com> From: Jia Zhu In-Reply-To: <20240424033916.2748488-3-libaokun@huaweicloud.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 在 2024/4/24 11:39, libaokun@huaweicloud.com 写道: > From: Baokun Li > > The err_put_fd tag is only used once, so remove it to make the code more > readable. > > Signed-off-by: Baokun Li Reviewed-by: Jia Zhu > --- > 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;