Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp396770rwb; Thu, 18 Aug 2022 05:58:30 -0700 (PDT) X-Google-Smtp-Source: AA6agR44G3hFd6fpe/HE8MaViWwnZS8uDkId2M3hDuFsF7BmN/XuXMAS2Y2Bk9BG0Cf8a3XPYF/X X-Received: by 2002:a05:6a00:22cd:b0:52f:706a:5268 with SMTP id f13-20020a056a0022cd00b0052f706a5268mr2834254pfj.80.1660827510686; Thu, 18 Aug 2022 05:58:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660827510; cv=none; d=google.com; s=arc-20160816; b=P8yjf67z7Qet7faL+piuJWJ15YfpvKAgteW+9vMXqIzbro/PquS8AmA+OfOPYSANs0 xdMFefS8N+s1eGSN6tD+XaDYDOtuLWuVPpUEe+3A7JhHyH/SPVizcMWjdvSmiOnM2SL4 xf9OvkKoSPpwzK039fIk/7DjrldqNobqfhZkqlyidrC3pexc9ZkIJk4aNlZZxhHkv37i JLre0ZLjoVivcjdqZHstyXe/kpQQvFiOzpByU6UFrPdcDbLNMPOZ3bqBr+++ngPtFDMs PAlNJHKJHbMEZWWls+ELghWsyv11WdHnQBqHm1NDJU05FioCHydPT2vj7NiAE3hsKJAN 5d4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=/HgjtgeykWVrqkJsegx8UP5Yn1INli8DF8M51EsYDms=; b=k00XdGqbmYzwF34PqOE8aCGfpv05uk/2FM54c0AEYFqm3EqexKOCNZVZaZHr8Q4WxJ 7/OQnpbbrwD/oSrcLr4tQRA6hLpyxAWNgoXhsw5zX9Vm7HL+a3BkAmgmR6ce5R7jTpuP ZrHDeZk2zHknM83K6CK4dmtbetN4m9rHXwwsKZ2VJhtjGCIVZGPQWI/gWozuQhH5DLQC tg81ZAGwD3+4wBlsmzrcpzxufltXqflKEBzYFGanoaGW9VboZml+tePGw/D70s24QZO1 Ggxb5lGmkj+m4HWv2swWkTvhRN14OFw/ozGMTMMygwRUnCkLDQIjR9DfEGd+LdOwFx7H GHyg== 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 y10-20020a056a00190a00b0052568123ceasi1572182pfi.315.2022.08.18.05.58.17; Thu, 18 Aug 2022 05:58:30 -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 S244585AbiHRMPs (ORCPT + 99 others); Thu, 18 Aug 2022 08:15:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244575AbiHRMPq (ORCPT ); Thu, 18 Aug 2022 08:15:46 -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 6EBE7A00C0; Thu, 18 Aug 2022 05:15:41 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R111e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045168;MF=jefflexu@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0VMal8Wq_1660824937; Received: from 30.227.66.106(mailfrom:jefflexu@linux.alibaba.com fp:SMTPD_---0VMal8Wq_1660824937) by smtp.aliyun-inc.com; Thu, 18 Aug 2022 20:15:38 +0800 Message-ID: Date: Thu, 18 Aug 2022 20:15:37 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [v2] cachefiles: fix error return code in cachefiles_ondemand_copen() Content-Language: en-US To: Sun Ke , dhowells@redhat.com Cc: linux-cachefs@redhat.com, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, "linux-fsdevel@vger.kernel.org" References: <20220818111935.1683062-1-sunke32@huawei.com> From: JeffleXu In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,NICE_REPLY_A,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 8/18/22 7:27 PM, Sun Ke wrote: > > > 在 2022/8/18 19:14, JeffleXu 写道: >> >> >> On 8/18/22 7:19 PM, Sun Ke wrote: >>> If size < 0; open request will fail, but cachefiles_ondemand_copen >>> return 0. >>> Fix to return a negative error code. >> >> Could you please also update the commit log? > > 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, return 0 is indeed unexpected when ^ returning > cache_size is an invalid error code. > Fix to return a negative error code. Fix this by returning error when cache_size is an invalid error code. >> >> Otherwise LGTM. >> >> Reviewed-by: Jingbo Xu >> >> >> BTW, also cc linux-fsdevel@vger.kernel.org >> >>> >>> 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; >>>       } >> -- Thanks, Jingbo