Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1375227rwb; Fri, 19 Aug 2022 02:31:08 -0700 (PDT) X-Google-Smtp-Source: AA6agR51if14B8jjQo4RWmIeVrChVZTllqKGk9rycd+5rk4pU07NxPV7sb5MadHmQwmYIXsyQWFv X-Received: by 2002:a05:6a00:3489:b0:532:830e:d4a7 with SMTP id cp9-20020a056a00348900b00532830ed4a7mr6892582pfb.13.1660901467841; Fri, 19 Aug 2022 02:31:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660901467; cv=none; d=google.com; s=arc-20160816; b=fTvfvjH5Y3b72PlB52ttkQu/6ZjRieULWjufsFqdxC/xCCcQwgs7Y8miVcVVMwj0NP rVHN7xNJ2owQUXsni0tp5P0o50K2OzDn0LGY7x7zSPQI+gkP46CNGVRq1TaD+9gVmwon HwXmb9XkRBQyaxJid4nwCD1KlxHzRs26yVMGwUt1rENBUuzS8C/hIKJJ46TkammJ+4Gp n6nS89H20gbOX7fYvqKhDLr3zgOt8F2SGs4RUts1e7vO/e0/h+m5vDILHxKS4BvbzSGb fkHHM76kDfqOxsw3bot9a5mgmhA4SnnOSjSxV2VmGhESSK4OXv707GbkUdb8OeeIuPky R6JA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date; bh=YOdUeMtHn3lRwQYOcYal2fD9GsTkzPOVYR+QWfaEQm0=; b=oBCxwPS/oCgAWG92mbfrr/JhBJ30G8saV8q2Wpkx+q190iv6mp4M+jE3qovS2ZWYZT tBBfm9gLMTjIsMg5XXgansXd43HdyE6yptgjJAooAciY6I0tM/i2L2KlhpE7tc0Q856b ny05BASK9Ddopj5dRTgQRdrjLB6l+NPTevHJ1W+a99CQgSMlHjLxd2P8YrFzQLCDwrSr vR1gNcR+jsFRxHg+tAbbfMeLKVQNr3+gf6TLlAzsBQr5IaOrAhA7RPJcMAi5bAcYc7bP 5w3e9cy6xxjsK74GW7T/a71zVFq39A+HC/78sk8O0FiE+lbXnpLK+Le/GvnynonxFBzV sxrA== 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=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 25-20020a631759000000b00429e0a469c9si3611687pgx.378.2022.08.19.02.30.56; Fri, 19 Aug 2022 02:31:07 -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=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348114AbiHSJTI (ORCPT + 99 others); Fri, 19 Aug 2022 05:19:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346010AbiHSJTG (ORCPT ); Fri, 19 Aug 2022 05:19:06 -0400 Received: from out30-57.freemail.mail.aliyun.com (out30-57.freemail.mail.aliyun.com [115.124.30.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B364A33364; Fri, 19 Aug 2022 02:19:03 -0700 (PDT) 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=ay29a033018046056;MF=hsiangkao@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0VMfb7tn_1660900738; Received: from B-P7TQMD6M-0146.local(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0VMfb7tn_1660900738) by smtp.aliyun-inc.com; Fri, 19 Aug 2022 17:19:00 +0800 Date: Fri, 19 Aug 2022 17:18:58 +0800 From: Gao Xiang To: Sun Ke Cc: dhowells@redhat.com, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, linux-cachefs@redhat.com, linux-fsdevel@vger.kernel.org Subject: Re: [Linux-cachefs] [PATCH v3] cachefiles: fix error return code in cachefiles_ondemand_copen() Message-ID: Mail-Followup-To: Sun Ke , dhowells@redhat.com, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, linux-cachefs@redhat.com, linux-fsdevel@vger.kernel.org References: <20220818125038.2247720-1-sunke32@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220818125038.2247720-1-sunke32@huawei.com> X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL 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 On Thu, Aug 18, 2022 at 08:50:38PM +0800, Sun Ke wrote: > The cache_size field of copen is specified by the user daemon. > If cache_size < 0, then the OPEN request is expected to fail, > while copen itself shall succeed. However, returning 0 is indeed > unexpected when cache_size is an invalid error code. > > Fix this by returning error when cache_size is an invalid error code. > > Fixes: c8383054506c ("cachefiles: notify the user daemon when looking up cookie") > Signed-off-by: Sun Ke Reviewed-by: Gao Xiang Thanks, Gao Xiang > --- > v3: update the commit log suggested by Jingbo. > > 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 > > -- > Linux-cachefs mailing list > Linux-cachefs@redhat.com > https://listman.redhat.com/mailman/listinfo/linux-cachefs