Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp178044lqd; Tue, 23 Apr 2024 20:49:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXkwC8R4LTYvMTte9H/ebB5pt7NhkntrnmjxGak7g/W2zXYfKoNbxllu2L5m14gPVqRk0jjA+4uM1RrMLOI48w57hfVy8mIYipbxc2dyQ== X-Google-Smtp-Source: AGHT+IGd1tfdiAd+rLyiuNrfrmTPAJb470xRoeF+rQxblT4d5zD1NVWXyNjQKHq3/RwPdF0d+Onm X-Received: by 2002:a05:620a:24c2:b0:790:7837:ad1 with SMTP id m2-20020a05620a24c200b0079078370ad1mr8144018qkn.22.1713930592935; Tue, 23 Apr 2024 20:49:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713930592; cv=pass; d=google.com; s=arc-20160816; b=BcO5OVpG3sf6d+AHzuIrdMyyhrC42UXhAOZR/FUL1+CQarl6AwxsFRsFXvmbt+OOjq UrxyizgQDygSt2LjaKL5If8x3n8jUqDc1ob76EmUMeM9GwGhdb9OfGypEAmNh8+l5Nua HntfI+8iHjxLBeazDrpAIK5HEUxxzOk2P/ofLfu4wNQlGfzpQfJx/ufl+WAPhCunl6kX OZfU8rQB4aI+/IPe2+F1HAFO5Do7DUqctqrkRo2ObPc9012L6T+faCX6zIaE5qFCHTZP UYACvzGn7F6FI/Hun2Fts/k2etKE3fLhK3sgG/YdWfaz615SfFWj3xP47QDZs/rdXkDD N/Hw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=US0H8N8tPnUz4QmTCeGWTIQascidj3dz11m1vtZ27jA=; fh=FGAq13Dh0ICWnTZ1bINaUEc79yKht6kuxMzZnIgqSjw=; b=c0AQKZqDbruvbT66fF8/QCvGFXKFZFiwHjd4Hs05rO3b92Wn3UzrVGFss1OHHJOu2i ppUNP9kUwag5vUeaxGyKVgNGyGaaiYwiwX662CKU4+JpInEWsRc6kwffsIHwkdI9E//k oC/OZUeCWpVNaMEn83kgKFKtKzS1GGFokgk+1SL/6oxH340cH5w/q3ACNH+XB3W2Fd5r GB+S65WUpjO2A7fCeQ7GzzvCsDQEGwbPQlcFMDM7xmPqprlm50br2KwS3GmeF/yf+qPp FkYwLvMeKPXQgBanUASKWJ4KEGVYgZClQFXzwDFCJlmCgz+YJYbgzExiCt9NHK6u6JMd RQzA==; 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-156239-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-156239-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id p24-20020a05620a057800b0078d678da2bcsi13673239qkp.770.2024.04.23.20.49.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 20:49:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-156239-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-156239-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-156239-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id AA6C61C237D4 for ; Wed, 24 Apr 2024 03:49:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BD9941448CD; Wed, 24 Apr 2024 03:48:36 +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 996F613B78F; Wed, 24 Apr 2024 03:48:33 +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=1713930516; cv=none; b=smp98S6+4WSFLJRHPAN69WmZv20KElJAKbPZGYmFVIeinUfbDYLcI6wyaXUgc2Q2AhU2pTd6f2MUYM2NTFCTVg3XVfwYAx5Vlc4vwdoKNNdvL6wAPApTbWNuPBBCgj47sdB/FsucQHjZW0U5VxLrokkbcMUdbTEehpi4oPzLoEI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713930516; c=relaxed/simple; bh=CJAsjwsABHJzCJkMGGnMV8RgnGwDDt/vfJyinn94n7g=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=rhg6Emxw2GHSgFGBMry9+q5pbgg5/GVheLT2Lrwe4Q0mw+N1jO5ShL5qhGuFzeg2nv965jGYEHABfjwzRwDLRnEDFWlWJ4NhJHgBEuN6z4uv7ZZulrF4BaRv0vp3Y6/FEBzZ6SpQq/tWNKhAvCGxgwDT1cW4dEUhI1cJ1vTGqUE= 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 4VPQ1z32jFz4f3jcy; Wed, 24 Apr 2024 11:48:23 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.112]) by mail.maildlp.com (Postfix) with ESMTP id EBDBF1A0175; Wed, 24 Apr 2024 11:48:30 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.104.67]) by APP1 (Coremail) with SMTP id cCh0CgCXaBELgShmKXE4Kw--.6143S6; Wed, 24 Apr 2024 11:48:30 +0800 (CST) From: libaokun@huaweicloud.com To: netfs@lists.linux.dev Cc: dhowells@redhat.com, jlayton@kernel.org, zhujia.zj@bytedance.com, jefflexu@linux.alibaba.com, linux-erofs@lists.ozlabs.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, libaokun@huaweicloud.com, Baokun Li Subject: [PATCH 02/12] cachefiles: remove err_put_fd tag in cachefiles_ondemand_daemon_read() Date: Wed, 24 Apr 2024 11:39:06 +0800 Message-Id: <20240424033916.2748488-3-libaokun@huaweicloud.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240424033916.2748488-1-libaokun@huaweicloud.com> References: <20240424033916.2748488-1-libaokun@huaweicloud.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID:cCh0CgCXaBELgShmKXE4Kw--.6143S6 X-Coremail-Antispam: 1UD129KBjvdXoW7Jw4rury5GF17Zry5KFWDCFg_yoWDKFX_uF 92vr1kXr4fCF1fXw42vr9YqFWqg3y8A3WFgws8GFy2ya95JrW3Jr4Dtry3Ary3Way8GF1q yrs5Z3WjqrnFgjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbPkFF20E14v26rWj6s0DM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6r1F6r1fM7CIcVAFz4kK6r1j6r18M28IrcIa0xkI8VA2jI8067AKxVWUXwA2048vs2IY02 0Ec7CjxVAFwI0_Xr0E3s1l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xv wVC0I7IYx2IY67AKxVWDJVCq3wA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVW8Jr0_Cr1UM2 8EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK6I8E87Iv6xkF7I0E14v26rxl6s0DM2AI xVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20x vE14v26r1Y6r17McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xv r2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20VAGYxC7M4IIrI8v6xkF7I0E8cxan2IY04 v7M4kE6xkIj40Ew7xC0wCY1x0264kExVAvwVAq07x20xyl42xK82IYc2Ij64vIr41l4I8I 3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxV WUGVWUWwC2zVAF1VAY17CE14v26r1q6r43MIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAF wI0_Gr0_Xr1lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4UJVWxJr1lIxAIcVCF04k26cxKx2 IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r4j6F4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_ Gr1j6F4UJbIYCTnIWIevJa73UjIFyTuYvjfU1WlkUUUUU X-CM-SenderInfo: 5olet0hnxqqx5xdzvxpfor3voofrz/ 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 --- 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; -- 2.39.2