Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp308064rwb; Thu, 18 Aug 2022 04:23:34 -0700 (PDT) X-Google-Smtp-Source: AA6agR6wY+Ai28LCmZ2Q9M1XwmiUxpqFj/DwK0ghcao5QuZ3bJAo2chKOcgVz2xIqEzO7bUftZuo X-Received: by 2002:a17:906:eeca:b0:730:6880:c398 with SMTP id wu10-20020a170906eeca00b007306880c398mr1636569ejb.706.1660821813315; Thu, 18 Aug 2022 04:23:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660821813; cv=none; d=google.com; s=arc-20160816; b=ncs+6Qr+yIsV5qdFNO1IG/HFZryvKIFILsQMZTF+yrIeNYe3qseXrBzHaGg9lR/BHR ULFXrPh94C7XCmTmCffxDOgc6rsXVe6X0UWeF5JfqH1zh1i+RkFLrgNlvPo3JIm828rQ gGvLPc1R6Lcetrneq/DnOPWHz4hrlcNW62DPYxFW3LsVCpLyWtcOZxh1MlyIOU5LH7bh hIcuxEhE4/XN/FL4CV1SQqzZFgtfO+UeIVz4EtUzw1Qfefk8hm/asaLMe3f1TJ1jcWTM ddpbfS1ObB/Ie9VZ8O/iN3p393YLvtNlurnLxmt/+TB7AVd6gew2NIfRv3ZIgsqHa7xG QlTw== 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=hB4TB6lIveCJQXcmj+OoK1wrDTEXmDXSiW4PO6gHBVU=; b=Hh37QpYA8drjrDqKHUk27vNTZgE0eM0DLj3GvyjsZNyRhFUbdx3lcC+YXESSZZrb30 5/iNf8HHKl6ob7B8KEa4r5PzOMXhCTuMdUqJq5V1t8LMEEUQ+puvpYHmMsbPNpN3e3MA BMulVHSTFGVqFHxB14bBfaD3JJP2/28GnN8W1WMvEAZyy5nYsqh6APJHHwZ0EQ6+rBC6 vGmzRBGVkOq6dCxyCcmvRGciO5XoPd739Q9LbxXFUTJG+YJZpNe4T9gGVH6dleXelpFO Fcs0udv326eNQkzBvZTHKR1J27XqOe1H+664H2dxjRDUMcAwWWj1thdtwvQn+mWt3t07 C5lw== 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 dz8-20020a0564021d4800b0043f4e1722a1si1107273edb.533.2022.08.18.04.23.07; Thu, 18 Aug 2022 04:23:33 -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 S244288AbiHRLII (ORCPT + 99 others); Thu, 18 Aug 2022 07:08:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243897AbiHRLIG (ORCPT ); Thu, 18 Aug 2022 07:08:06 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BD83A284A; Thu, 18 Aug 2022 04:08:04 -0700 (PDT) Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4M7hrY5YVzznTZC; Thu, 18 Aug 2022 19:05:49 +0800 (CST) Received: from kwepemm600010.china.huawei.com (7.193.23.86) by dggemv711-chm.china.huawei.com (10.1.198.66) 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 19:08:02 +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 19:08:01 +0800 From: Sun Ke To: CC: , , , , Subject: [v2] cachefiles: fix error return code in cachefiles_ondemand_copen() Date: Thu, 18 Aug 2022 19:19:35 +0800 Message-ID: <20220818111935.1683062-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: dggems702-chm.china.huawei.com (10.3.19.179) 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/cachefiles/ondemand.c b/fs/cachefiles/ondemand.c index 1fee702d5529..ea8a1e8317d9 100644 --- a/fs/cachefiles/ondemand.c +++ b/fs/cachefiles/ondemand.c @@ -159,7 +159,7 @@ int cachefiles_ondemand_copen(struct cachefiles_cache *cache, char *args) /* fail OPEN request if daemon reports an error */ if (size < 0) { if (!IS_ERR_VALUE(size)) - size = -EINVAL; + ret = size = -EINVAL; req->error = size; goto out; } -- 2.31.1