Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2624604rdg; Mon, 16 Oct 2023 09:42:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE4kl57AuPxN0ugIlUev5IBX8cxSUMMFBBmBRQ3AtR1Db25WfEmzG/6ZUP34J6fmSqPU4YQ X-Received: by 2002:a05:6a20:4321:b0:161:7a0c:3c37 with SMTP id h33-20020a056a20432100b001617a0c3c37mr40864651pzk.5.1697474575752; Mon, 16 Oct 2023 09:42:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697474575; cv=none; d=google.com; s=arc-20160816; b=v1qRWeR6SdbCVEyrxUUAFRCkGNELdBFS3LDT8bFeF1Tqy5gMixwe/5IRNJTAN3BRvu pdew+VSdJWFsXAWbfz9w1GVJLmjaHh0uau0qqgxOi1qAVNrQSUny1dv75QQwfwAqTrLd 9Vk5aRahYzhUqkLEuYNdMAG3t2keKVqKi+4xXu/UJ/R+KNIx20rXBzYIqVugvIaCPjtr 5p3RbkjUzDL0B0pu49kojdiwq/xNkBOg6Vdu+YSg9LQapfb2hocpFZun6Xr+GB5UrJc0 G6x/29hIIcwxukrHEX9J4blPDBZYXwuD2HTPbAOY7nxaoLijSCM1sEWd94Y6CiEZtDtz uevQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:content-id:mime-version:subject :cc:to:references:in-reply-to:from:organization:dkim-signature; bh=rbzg7U/87dJSaK89YmTgCyu23XfU1BhnpwaB496FV9g=; fh=lyBdACTK3Hx6JpyUTngk3nwDzfPmt3xk5b+coim1dyQ=; b=CknyVOYId3UcdzcvA2RRkzcttWw5zn5XmftQ5B11zOKIA8N2Jz3bUMxaWBJrDPIzVS EzpGdzCTP7hNZiWp7q9kcjpE9aXt4rMDsn3eGEXS1XxMcRRiIpjW/mHxODE6X7upcL6a bVvWCj65FcXEcpBsDLpEdDUWLJ99E37dS9UJWb7BnzHQHcHTjON/krSNq8mWwvdp7W6G g5fgZD2qi1QA4XL2C2uijUTW0nvgDmyCLHy/BrV5k4Q6NfjC+FZVlVgbb3ldPJpv3Fpg SXYooIStHBtupSvcEr8bMYKUYpHiSmiZUYs8qelO7FCFRe180pDZuCH4g0YPfrCT34Wo miWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BOBTuB52; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id f29-20020a63755d000000b005ad35f5a7basi7252206pgn.507.2023.10.16.09.42.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 09:42:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BOBTuB52; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id A73998085FBF; Mon, 16 Oct 2023 09:42:40 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234254AbjJPQmS (ORCPT + 99 others); Mon, 16 Oct 2023 12:42:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234427AbjJPQl6 (ORCPT ); Mon, 16 Oct 2023 12:41:58 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 976001FEC for ; Mon, 16 Oct 2023 09:31:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697473880; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=rbzg7U/87dJSaK89YmTgCyu23XfU1BhnpwaB496FV9g=; b=BOBTuB52y0K0wAR6s5CX7xgG1BncSFYX1sn3YfPs1bk0qfe7Wa4BiskcwpkSPMKCQ0r5U/ qo3DAlcGX3nEFEsVMLh67Lhri50sAV56zmTQJH+qGWU/NuxQHOGhVU/F+wXFR+fgxvIuAe Y8Zf8lhtAI+B+rmlKFxv+LPgw34oOKQ= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-613-g1DVukGdOg29WJloZ1VP1g-1; Mon, 16 Oct 2023 12:31:16 -0400 X-MC-Unique: g1DVukGdOg29WJloZ1VP1g-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 523CF81D9E2; Mon, 16 Oct 2023 16:31:15 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.178]) by smtp.corp.redhat.com (Postfix) with ESMTP id B7B49492BEE; Mon, 16 Oct 2023 16:31:12 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <11ec6f637698feb04963c6a7c39a5ca80af95464.camel@kernel.org> References: <11ec6f637698feb04963c6a7c39a5ca80af95464.camel@kernel.org> <20231013155727.2217781-1-dhowells@redhat.com> <20231013155727.2217781-3-dhowells@redhat.com> To: Jeff Layton Cc: dhowells@redhat.com, Steve French , Matthew Wilcox , Marc Dionne , Paulo Alcantara , Ronnie Sahlberg , Shyam Prasad N , Tom Talpey , Dominique Martinet , Ilya Dryomov , Christian Brauner , linux-afs@lists.infradead.org, linux-cifs@vger.kernel.org, linux-nfs@vger.kernel.org, ceph-devel@vger.kernel.org, v9fs@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-cachefs@redhat.com Subject: Re: [RFC PATCH 02/53] netfs: Track the fpos above which the server has no data MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2841425.1697473872.1@warthog.procyon.org.uk> Date: Mon, 16 Oct 2023 17:31:12 +0100 Message-ID: <2841426.1697473872@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 16 Oct 2023 09:42:40 -0700 (PDT) Jeff Layton wrote: > > (7) If stored data is culled from the local cache, we must set zero_point > > above that if the data also got written to the server. > > When you say culled here, it sounds like you're just throwing out the > dirty cache without writing the data back. That shouldn't be allowed > though, so I must be misunderstanding what you mean here. Can you > explain? I meant fscache specifically. Too many caches - and some of them with the same names! > > (8) If dirty data is written back to the server, but not the local cache, > > we must set zero_point above that. > > How do you write back without writing to the local cache? I'm guessing > this means you're doing a non-buffered write? I meant fscache. fscache can decline to honour a request to store data. > > + if (size != i_size) { > > + truncate_pagecache(&vnode->netfs.inode, size); > > + netfs_resize_file(&vnode->netfs, size); > > + fscache_resize_cookie(afs_vnode_cache(vnode), size); > > + } > > Isn't this an existing bug? AFS is not setting remote_i_size in the > setattr path currently? I think this probably ought to be done in a > preliminary AFS patch. It is being set. afs_apply_status() sets it. This is called by afs_vnode_commit_status() which is called from afs_setattr_success(). The value isn't updated until we get the return status from the server that includes the new value. > > + loff_t zero_point; /* Size after which we assume there's no data > > + * on the server */ > > While I understand the concept, I'm not yet sure I understand how this > new value will be used. It might be better to merge this patch in with > the patch that adds the first user of this data. I'll consider it. At least it might make sense to move them adjacent to each other in the series. David