From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F6EACDB465 for ; Mon, 16 Oct 2023 16:42:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234558AbjJPQmV (ORCPT ); Mon, 16 Oct 2023 12:42:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233912AbjJPQl6 (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 AB6611FFC for ; Mon, 16 Oct 2023 09:31:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697473881; 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=VwwMwHsGJUTary7SWMI9EQfJU8TToDQ5Iu2EUoZjfbxWwzaB8kqO7Yvw+8IMqF9zB4rI1T waVNl+edZfXQskxn1uZQkoicRtjcWWMv94dRakrAvq52s4SEBm3OSq+uB30HNk91+r68GC EbtH3+a3IlZtOW92+eTmPpheMObSJgc= 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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