Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp222694rwa; Sat, 20 Aug 2022 02:27:11 -0700 (PDT) X-Google-Smtp-Source: AA6agR5yUVdWf99k4bIpz0zWeVdeADZwwyBBTEvv+nbeXfJx4VyaKpPqX1WnzcDKBLfZ9I5Bn+tk X-Received: by 2002:a17:907:9620:b0:730:d5f4:d448 with SMTP id gb32-20020a170907962000b00730d5f4d448mr7323342ejc.45.1660987630884; Sat, 20 Aug 2022 02:27:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660987630; cv=none; d=google.com; s=arc-20160816; b=ZlaBdn8dZsot26guIG8nyb8M5VjtSDfbpDr1o2L0aUA/ef64dqNW8rNyVJv8hZonlk 2vl6XjMSudKWg09JIWBdBH2fbYLCMeKAdfU9yzt8kFcfU+wiIagq5F34nxPj4SaHuZdn 1QisEKSy088yiI3aHlThpSj4JHooX+UX4fFGBdVjecchUUqztBF8S5uchONCqpP5PS5H y53JILea0EMfoteJwJn6BZKJoRV6SKxfS7/xA1nSsQ8FGU/8qk386S4Vtmoe9Ve0Gphn wj4wahkj4Mc2oCOpN6FO+pGt+4McDsSbyUtYLnWxWqB9+zOFC32gRnKvV8V5fPhWMsJg j0sQ== 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=CYUCtkrH8d7MKM3Grjsfg4iJBCH9QsmcDuAMzavtWf0=; b=XRxdfDUOWPNXDZpBGYwkQYblxb+DCmw5ECcZlNpBDWvToroIWnuV+2fMc9OeJwhBjt TevtGk4GlC9P5hmIx8yEaae22i7VxtMvpzhHwMYpupFFtWYA7uhO0joC+U/3iO02cURF nERvWHmhfUNA3+0SocrJkUwCVQ8tIuS6h6icoOskKSU5mOzhhgkrzBO6qherj2JDOG3P KJfmXCMCrp9XeihzvmWT/5gpryGCao2KuszKjzZ0Y/lDA8jK/Zm7SfRze5/icDnOOIOU 0UGoKIWILYcPi8ehTitQpGw5/1CfBTXZg+AOaDokwPdJvzNmldeA2eWYgK7EwazchU0L tDew== 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 r14-20020a1709067fce00b00738a50268d3si4132803ejs.417.2022.08.20.02.26.45; Sat, 20 Aug 2022 02:27:10 -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 S1344182AbiHTJW2 (ORCPT + 99 others); Sat, 20 Aug 2022 05:22:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244085AbiHTJW0 (ORCPT ); Sat, 20 Aug 2022 05:22:26 -0400 Received: from out30-44.freemail.mail.aliyun.com (out30-44.freemail.mail.aliyun.com [115.124.30.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D7D1B69C7; Sat, 20 Aug 2022 02:22:23 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R121e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046056;MF=jefflexu@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0VMj1MZi_1660987338; Received: from 192.168.31.65(mailfrom:jefflexu@linux.alibaba.com fp:SMTPD_---0VMj1MZi_1660987338) by smtp.aliyun-inc.com; Sat, 20 Aug 2022 17:22:19 +0800 Message-ID: Date: Sat, 20 Aug 2022 17:22:19 +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: [PATCH v3] 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: <20220818125038.2247720-1-sunke32@huawei.com> From: JeffleXu In-Reply-To: <20220818125038.2247720-1-sunke32@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 8:50 PM, 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 LGTM. Reviewed-by: Jingbo Xu > --- > 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; > } -- Thanks, Jingbo