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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21E74CDB482 for ; Mon, 16 Oct 2023 16:31:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 943CD8D00B5; Mon, 16 Oct 2023 12:31:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8F3B18D0001; Mon, 16 Oct 2023 12:31:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7BAF88D00B5; Mon, 16 Oct 2023 12:31:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 6CE5E8D0001 for ; Mon, 16 Oct 2023 12:31:24 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 1E3BB160A70 for ; Mon, 16 Oct 2023 16:31:24 +0000 (UTC) X-FDA: 81351864888.20.3FE2531 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf05.hostedemail.com (Postfix) with ESMTP id 41170100024 for ; Mon, 16 Oct 2023 16:31:22 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=VwwMwHsG; spf=pass (imf05.hostedemail.com: domain of dhowells@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1697473882; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=rbzg7U/87dJSaK89YmTgCyu23XfU1BhnpwaB496FV9g=; b=EEcu1ayVq9Awgxq193Plwp/GCWD3i1wVCJJRiMxErt1TvFMehmmo3P1t290Z5JgcpNTbds 6yzeB01iZ2xazHaZn1AMFj1ZyW39kAzoMGzyXRQjk9v3+EuUyEgt5uwCibt0yqekSsS5Db g6aiXzikiEorOFBgh0DtG9OegkwfzR0= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1697473882; a=rsa-sha256; cv=none; b=1vJ/o2MfTLo9n2iSBLUzN+t9n/4OQHqlmLwW8+2pmju3ZSPwUA1SEoApD6jXkwMYq5zt1T n9A5BVuqDDfViUKW8W5j3POe8rwv//CO40oJpm6kXUi/SD7pplwiiccujuO7Gkd6cnNKcr WwCtBmBtLcv+oEm4Ay/a9D6NPNnQhsA= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=VwwMwHsG; spf=pass (imf05.hostedemail.com: domain of dhowells@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com 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 X-Rspamd-Queue-Id: 41170100024 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: bampty6q7it1key9wbxp1kpnc3m8ndwp X-HE-Tag: 1697473882-277158 X-HE-Meta: U2FsdGVkX19qViErvF9C/lKzKLolAB/3jeydF5i3f05HMz8CFlhvDRWzfluDHLN+IhQyvwQX/6fWqSE8d/ADt44bRCXqn6exVhTiUrinrbU0k7Vw9g3XTD+IEiUq5HOjjYR/aBOzD0u2Y15kXk/r9UK4Q6bQlz5YdjUD4/DgOYpMM3MzQIxWEAst+qVtcr+8FelTP8PDQZ1yWdWZm/Y+nMhVF2lTfDZPIU/nfMDn+0AZV31In5OKejk3TDf2VAqjiY0/kX6MTrNEr5yx2fWRGNdr2rsMgWGNAlDQrlvF/YUlr15/kSxMJSirQNQUz/Yl76BH1sxZ+TzOtRbVKirm6ZR2xHI0KwI7BaSGFa5mbO1ilq2IGlsM32Ba1mnTjEiV3nb7Ap8ScOXcgQ30JTbHr0wOXNvCLhPVRJS2Ie2vuNpWOx7RYVryjoLSUmOHcMGmlHT44LvWxO9TYlaDla2ONL65+0BZM4/l04VzN650ENCXBbykDjVvZn4DBwCo0tQQJm3MlBeAetkbjh5oSE+6FPB5V69PIWq1PYa22E/og3tqUgXfrA+8oJrzHijJ8fvPePn/+obobDdCBsVLZAck0IKHngVUVQ2Oz7N2iS9Y7HwoG/RS32cjlbphc0Aw03ttkdTDsP7XCaKdRsimivokTQMe+C5pkNLFHVlMRUNyLnqQ881ZShdRWL3UCt/3QHRt+1b/tbXCnsriTIV3/rC7eVl/4smDvFuyKln8Md28DrPDUr+Q7+teyQlmIScZiQM3VrrhRAlxp8ogbfzKd6r1fcn8tlux22qZ2vjAxtTQf+OJAqbyHce//bjOn+h0bxcx/hWWJhoKgY3Ha0TAc/1mbNslaz0pRGdSncOImWqbAdbstlLRbmANvp1DjE0oOrFDkCospASNNzYxm+booQnmAs2m8qwjUTKBok1yUSddQj1zlpmXCC+p9zhwvYgAPFCPuItNxn66CxJtJN30bit AeDFaom0 ZSaR3mlLBRvZWaI2NSdeXk/WJB5Xu3QvXQKZyyT+zromwbFzSJ6qTM3kVVzC1EW8pS4rOvmc+LNr0Dn9GLov92GWLxkpq03aoBKSACv3EZoU+BapSrlah/wKPLln04MK2k73ICbrNGc+4jGTA6WPcHrPLao/9oKPg0oDiQv5H6FpOZId74P8fb19ikBQUAQgI4wImxLv3LMcSymBwhCB13FyNLA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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