Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp225831rwb; Thu, 18 Aug 2022 02:43:44 -0700 (PDT) X-Google-Smtp-Source: AA6agR58xAIXco1aoHJKKBiuiF5boVf505PIo16W+U+1K5+wLE6Fq9bQrfkG9yer34iyhSTjOSnK X-Received: by 2002:a17:902:f68d:b0:16f:2314:7484 with SMTP id l13-20020a170902f68d00b0016f23147484mr1851510plg.136.1660815824523; Thu, 18 Aug 2022 02:43:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660815824; cv=none; d=google.com; s=arc-20160816; b=aWqZUtGs5E3oaNs2o1hIJjGaNmmeE7XwoIAJdsBcxHQh7NkrVoR3qc8BZGJaZA/bgc g5khF9BMi5P7jjymn+18QUSRXutp5pYqbTmi+9L6FXhDvb5i4i6OEOXAVoGZEcfb8VAW J7k86td7nvVKreE0IYPlX/kge4hEzx6BE4V15tUjwSyPrP5QuSXuT6JxYb6kw0SMoe1e A+sfkyXjACvDeKRt6LLdG5GUZcN1bBpFcV87U3KFnZ0E2XIqeOryq7AszsPhik03IVkM HH52Be+o4zrw+HigcFQ2hD+rkcdEcOBC3tafAkqhalny9jM6O+cVM/PhS52Va6S/aoSc tAeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=/fGtXBQseb+0vEp6KDZ5WWbzPltzRHQnVZfxqL6DAts=; b=h3SZjsCLmfEiuRBFuIFdqnULLvyaN/0cITxoXAQDaMB0N285p+Et5a0d9b4FwBPZ2F TMKtimzmjXeqGVRo6vSb0YBM6s5NFDklB/qwM/I3wOussEl7aH8572UAdgMZOixbOBp/ /jg+LgJMXmOqxZvGLWBsr2muq8hFagSGBOv8N9uwGSZgUJGD8DiTI2q5Hm/Aqob6DqiC 9nIpYDsDpr5M7r30pcenVK3p497UOwE96uek/WfQ+fOQcfvBWSASOLbILQu87IIYoa80 P8tjmuAHUTFsMYu/LMJGarrg6533DCUcPUHNZ8Un7r7G4hz7ZlVDkyWCrY+vlvMUpC2+ 9WQw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m14-20020a056a00080e00b0052aeaff99efsi1322462pfk.39.2022.08.18.02.43.31; Thu, 18 Aug 2022 02:43:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240172AbiHRJiM (ORCPT + 99 others); Thu, 18 Aug 2022 05:38:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230168AbiHRJiK (ORCPT ); Thu, 18 Aug 2022 05:38:10 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0AAE6B14CE; Thu, 18 Aug 2022 02:38:09 -0700 (PDT) Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.53]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4M7fqT2R7Qz1N7JQ; Thu, 18 Aug 2022 17:34:45 +0800 (CST) Received: from kwepemm600010.china.huawei.com (7.193.23.86) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 18 Aug 2022 17:38:07 +0800 Received: from huawei.com (10.175.127.227) by kwepemm600010.china.huawei.com (7.193.23.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 18 Aug 2022 17:38:06 +0800 From: Sun Ke To: CC: , , , , Subject: [PATCH] cachefiles: fix error return code in cachefiles_ondemand_copen() Date: Thu, 18 Aug 2022 17:49:39 +0800 Message-ID: <20220818094939.1548183-1-sunke32@huawei.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.127.227] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemm600010.china.huawei.com (7.193.23.86) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If size < 0; open request will fail, but cachefiles_ondemand_copen return 0. Fix to return a negative error code. Fixes: c8383054506c ("cachefiles: notify the user daemon when looking up cookie") Signed-off-by: Sun Ke --- fs/cachefiles/ondemand.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/cachefiles/ondemand.c b/fs/cachefiles/ondemand.c index 1fee702d5529..a31d3ff0ce5f 100644 --- a/fs/cachefiles/ondemand.c +++ b/fs/cachefiles/ondemand.c @@ -161,6 +161,7 @@ int cachefiles_ondemand_copen(struct cachefiles_cache *cache, char *args) if (!IS_ERR_VALUE(size)) size = -EINVAL; req->error = size; + ret = -EINVAL; goto out; } -- 2.31.1