Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp973360pxb; Fri, 22 Apr 2022 15:42:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzqb0TYLRy9ESHIYPhuhQXX58MxPhCPyjoQwpQKusH4BEFEvWIHLP/PHmMGJN7ooa+pdGtz X-Received: by 2002:a17:90a:a593:b0:1c9:b837:e77d with SMTP id b19-20020a17090aa59300b001c9b837e77dmr7599529pjq.205.1650667371857; Fri, 22 Apr 2022 15:42:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650667371; cv=none; d=google.com; s=arc-20160816; b=h8JFvUBfOrM/IDTLYQdwbNCFD3jL3IhFJLzmcPKTxZrzQRK+ZYXEk1tcA9oWgkyMz5 6t7/iR71xZY6by9nJweY7YT8Vbw7HkPeRydkOR875/W4KpfHYXVq/bo0+63Nf1mj3AL1 90ONJNJ5gEfIyPlDCvVxYhGvfu8nYrg2CE1de/a9odMfqQmO7YE36zSBs062/oSuFHpf Yy6lyVxzs2Qu0zVnzocnuhsfIByELBtWMqoMdIbaVU+OHgdJEBnQIxDyCisN/73mVE+F ivEnBcZBH9vhvI/Uc1LXjvmxXSsD5UX91Sx4XUmF+Kdfc/MsUgOi5WePCyBXzmLHFHTt hTxA== 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=x9X3883O7391MN+pYKkS/OTk6UdM57/FrdxWCZuVirw=; b=UFQkQFyzrUrB4vH8wAnDtugXDJPdoXLG+wvYC5OCRKGSkw8VSY/R9KC+vq9QQyWSxi 92wi9wrBInSsOtE6fSRCHKiNESymcu0Gubia/jgYZEXmnr6vjIvSY/9baUcE2rLTgWtc 5vhXXDKSd/GoVfDUiGVMDvSy90OdvoQSXDqi6FPCZl8TsmaEAXngQeWqOl3kntldkFIk Ev4RVw0d7Sr0qjHdCEJBxVBvCqJVb2JhBz068l90sr145ME67xAnQO+Fg1PcYFb36f7S rClxLUZ4CqELcXMxVV3AtpCROlBxlrzRK/RO3GTEtX8g1Z66Tqz01rofs5Wgs0zlL1Eq dsCQ== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id x7-20020a634847000000b003aa65024928si3820676pgk.224.2022.04.22.15.42.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 15:42:51 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6E2562CC995; Fri, 22 Apr 2022 13:31:25 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1389931AbiDUPOl (ORCPT + 99 others); Thu, 21 Apr 2022 11:14:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232354AbiDUPOl (ORCPT ); Thu, 21 Apr 2022 11:14:41 -0400 Received: from out30-131.freemail.mail.aliyun.com (out30-131.freemail.mail.aliyun.com [115.124.30.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B60BB427E3; Thu, 21 Apr 2022 08:11:50 -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=e01e04357;MF=jefflexu@linux.alibaba.com;NM=1;PH=DS;RN=19;SR=0;TI=SMTPD_---0VAg.y.s_1650553903; Received: from 192.168.31.65(mailfrom:jefflexu@linux.alibaba.com fp:SMTPD_---0VAg.y.s_1650553903) by smtp.aliyun-inc.com(127.0.0.1); Thu, 21 Apr 2022 23:11:45 +0800 Message-ID: Date: Thu, 21 Apr 2022 23:11:43 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH v9 06/21] cachefiles: enable on-demand read mode Content-Language: en-US To: David Howells Cc: linux-cachefs@redhat.com, xiang@kernel.org, chao@kernel.org, linux-erofs@lists.ozlabs.org, torvalds@linux-foundation.org, gregkh@linuxfoundation.org, willy@infradead.org, linux-fsdevel@vger.kernel.org, joseph.qi@linux.alibaba.com, bo.liu@linux.alibaba.com, tao.peng@linux.alibaba.com, gerry@linux.alibaba.com, eguan@linux.alibaba.com, linux-kernel@vger.kernel.org, luodaowen.backend@bytedance.com, tianzichen@kuaishou.com, fannaihao@baidu.com, zhangjiachen.jaycee@bytedance.com References: <20220415123614.54024-7-jefflexu@linux.alibaba.com> <20220415123614.54024-1-jefflexu@linux.alibaba.com> <1445691.1650550659@warthog.procyon.org.uk> From: JeffleXu In-Reply-To: <1445691.1650550659@warthog.procyon.org.uk> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,UNPARSEABLE_RELAY autolearn=unavailable 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 4/21/22 10:17 PM, David Howells wrote: > Jeffle Xu wrote: > >> + if (IS_ENABLED(CONFIG_CACHEFILES_ONDEMAND) && >> + !strcmp(args, "ondemand")) { >> + set_bit(CACHEFILES_ONDEMAND_MODE, &cache->flags); >> + } else if (*args) { >> + pr_err("'bind' command doesn't take an argument\n"); > > The error message isn't true if CONFIG_CACHEFILES_ONDEMAND=y. It would be > better to say "Invalid argument to the 'bind' command". Right. Or users may gets confused then. Will be fixed in the next version. > >> -retry: >> /* If the caller asked us to seek for data before doing the read, then >> * we should do that now. If we find a gap, we fill it with zeros. >> */ >> @@ -120,16 +119,6 @@ static int cachefiles_read(struct netfs_cache_resources *cres, >> if (read_hole == NETFS_READ_HOLE_FAIL) >> goto presubmission_error; >> >> - if (read_hole == NETFS_READ_HOLE_ONDEMAND) { >> - ret = cachefiles_ondemand_read(object, off, len); >> - if (ret) >> - goto presubmission_error; >> - >> - /* fail the read if no progress achieved */ >> - read_hole = NETFS_READ_HOLE_FAIL; >> - goto retry; >> - } >> - > Sorry, it's my mistake when doing "git rebase". The previous version (v8) actually calls cachefiles_ondemand_read() in cachefiles_read(). However as explained in the commit message of patch 5 ("cachefiles: implement on-demand read"), fscache_read() can only detect if the requested file range is fully cache miss, whilst it can't detect if it is partial cache miss, i.e. there's a hole inside the requested file range. Thus in this patchset (v9), we move the entry of calling cachefiles_ondemand_read() from cachefiles_read() to cachefiles_prepare_read(). The above "deletion of newly added code" is actually reverting the previous change to cachefiles_read(). It was mistakenly merged to this patch when I was doing "git rebase"... Actually it should be merged to patch 5 ("cachefiles: implement on-demand read"), which initially introduce the change to cachefiles_read(). Apologize for the careless mistake... -- Thanks, Jeffle