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 79E8DC3DA6E for ; Wed, 3 Jan 2024 19:43:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A06D56B03A6; Wed, 3 Jan 2024 14:42:59 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9B7256B03AB; Wed, 3 Jan 2024 14:42:59 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8A5986B03AC; Wed, 3 Jan 2024 14:42:59 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 7B6176B03A6 for ; Wed, 3 Jan 2024 14:42:59 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 4F7A8A0172 for ; Wed, 3 Jan 2024 19:42:59 +0000 (UTC) X-FDA: 81639022878.03.9564A1F Received: from nautica.notk.org (nautica.notk.org [91.121.71.147]) by imf11.hostedemail.com (Postfix) with ESMTP id E800840026 for ; Wed, 3 Jan 2024 19:42:56 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=codewreck.org header.s=2 header.b=LWwj+WDn; dkim=pass header.d=codewreck.org header.s=2 header.b=LWwj+WDn; spf=pass (imf11.hostedemail.com: domain of asmadeus@codewreck.org designates 91.121.71.147 as permitted sender) smtp.mailfrom=asmadeus@codewreck.org; dmarc=pass (policy=none) header.from=codewreck.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1704310977; a=rsa-sha256; cv=none; b=vFb2NmkI5su5GL7iZFNweJNV72GbNMmhVFk+bSznSoGhWupvlDWOxQuPhVF1xS8eqCn3SQ yHmqxzIC+INwYPsJpYyTUQYFEdXTCO7Bg7QOWAlwWrTpyTZS0I5sbPnqIQSc1Z4buvJ/0z W4mYJQo7zGH/DKM3PgtecwECae1aJHc= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=codewreck.org header.s=2 header.b=LWwj+WDn; dkim=pass header.d=codewreck.org header.s=2 header.b=LWwj+WDn; spf=pass (imf11.hostedemail.com: domain of asmadeus@codewreck.org designates 91.121.71.147 as permitted sender) smtp.mailfrom=asmadeus@codewreck.org; dmarc=pass (policy=none) header.from=codewreck.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1704310977; 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=vmsIH42o366lLCEtX1AOBPqwGBCA85i22kuEmfl/pd4=; b=XzaizGIhlBxhLE3CT2+cCHTyMRYoAokTMxBk9b9ZshnR8vldrlqcviuzHLVXnOrYm4btyl 9ZCW3N0lqkobVjPuVsV8X7RvJ8fn5/btvTv+7PjUZDVSBZPJZIT2XK14mQw0ij/WKQI6CY TvNWTL6y9nFl9Yaxbdzap4KM0QK1Jhk= Received: by nautica.notk.org (Postfix, from userid 108) id F2648C01F; Wed, 3 Jan 2024 20:42:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codewreck.org; s=2; t=1704310974; bh=vmsIH42o366lLCEtX1AOBPqwGBCA85i22kuEmfl/pd4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LWwj+WDnHlGIP8EddYD3ijwsipowZRszG5+7mmCFYhPYcMYSgYc5OJWYKs/tWPFHN rrohSgHE3FDw1Mz8MzqKaodyJNeoI6TPLLL1d9Q1NJ66DkBG1MToMhqviNGVurzibK 1v22R0jso4fpbQJhRwbvPhzlAx+wgUiIT1fhTsxbUlHcy+LZCp5AuuEDVpHZvdvm4Q tz/qGu7pt38R1ENarIYiaSDSKJWDhbYJ3ITsB+lf+1WGa1O/YU+Zn72WKAxHgI36F7 R0VGRHPjU7EG0v4NoM3+uFtkJeOVM0NL97kSEtIGAUuzOaFEK4U+GXIQ0jdzOpRbY9 awVfqCK9ksGxA== Received: from gaia (localhost [127.0.0.1]) by nautica.notk.org (Postfix) with ESMTPS id C491EC009; Wed, 3 Jan 2024 20:42:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codewreck.org; s=2; t=1704310974; bh=vmsIH42o366lLCEtX1AOBPqwGBCA85i22kuEmfl/pd4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LWwj+WDnHlGIP8EddYD3ijwsipowZRszG5+7mmCFYhPYcMYSgYc5OJWYKs/tWPFHN rrohSgHE3FDw1Mz8MzqKaodyJNeoI6TPLLL1d9Q1NJ66DkBG1MToMhqviNGVurzibK 1v22R0jso4fpbQJhRwbvPhzlAx+wgUiIT1fhTsxbUlHcy+LZCp5AuuEDVpHZvdvm4Q tz/qGu7pt38R1ENarIYiaSDSKJWDhbYJ3ITsB+lf+1WGa1O/YU+Zn72WKAxHgI36F7 R0VGRHPjU7EG0v4NoM3+uFtkJeOVM0NL97kSEtIGAUuzOaFEK4U+GXIQ0jdzOpRbY9 awVfqCK9ksGxA== Received: from localhost (gaia [local]) by gaia (OpenSMTPD) with ESMTPA id bdfe584f; Wed, 3 Jan 2024 19:42:39 +0000 (UTC) Date: Thu, 4 Jan 2024 04:42:24 +0900 From: Dominique Martinet To: David Howells Cc: Christian Brauner , Jeff Layton , Gao Xiang , Steve French , Matthew Wilcox , Marc Dionne , Paulo Alcantara , Shyam Prasad N , Tom Talpey , Eric Van Hensbergen , Ilya Dryomov , linux-cachefs@redhat.com, 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-erofs@lists.ozlabs.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Latchesar Ionkov , Christian Schoenebeck Subject: Re: [PATCH 4/5] 9p: Always update remote_i_size in stat2inode Message-ID: References: <20240103145935.384404-1-dhowells@redhat.com> <20240103145935.384404-5-dhowells@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20240103145935.384404-5-dhowells@redhat.com> X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: E800840026 X-Stat-Signature: 4sw88dmbcdzwoj1e5icunyqfx3c4d1pf X-Rspam-User: X-HE-Tag: 1704310976-869258 X-HE-Meta: U2FsdGVkX1+qdmKzoLkQE+7Em4ctQmIGzY9rKNUij/EOKo7Zzuw/0L5tv6U2222MBI/Z25UyqGv2+tBCmqgYg9wJN81CUIVv0sBruwpFvF7bra2ztPatj+0moOeCrmt1b8V+iE9GB1ZNFVS+tWTdWMj7NV2hj+S8Tg0SuAyoyeEYjGZMQFSuwNeExeZQMf44um2y1yC6wxxIvh2v4Mxzy+ITZcJIv2kCGeaHea82ROn5QzVXDsy77baOiDroHbyjOoZhGv/KWIGrZHUPYbKi77fSpijBCqn9SBKRCp5XUZiZyoFq/i8LV8fn0lySgftESbPVoixhuq8l6xn8U7C7X+4rfpJzY1Bq3GMK1eTM7V+45I9UqhPyIwzz19uXB3VneEzvFA30HV5QxddOPhnLxVYpzWpOSnYgIkJEuQaclO2E0Kmgh0EG9zHq3ZxbDL0KrloPs7/plaW24mGS2WQcmNrW6tY4Fja/j1SZ8SFRcIkRBz3IUj1KYf5yey5yYGPGepDPLIZ1xRBsLx8g5PVPUuy3fGajSb/MB58+dMzSRbCQJxzsOHhaOu/OPy+zC0Jer+kAyN4qnSwRnlrjeLD9tE7bud1Mdi1zGEXezFuUz8Tz7C55txp9Z/k1lUCTVvwT4DxzM6KodCPAgy0ZuZytmNDWAEDVKyZofWKkzAIn/cwFYrwVM9ET3uC5V38nCFdgmdaYgxziHSnXpzXrIUVlFRXAmTS23DDdDO33WgifyMBX6Z48i6DSfBXEoEN2mHUtx2YxBtBLXWrqbTjekyik9YQ1tHrHvMbrEGXZABu0reYiy6Vge4/hLYDgz6K1d/xJlaozQ41TyLl29iVewdn6Za6IRwgpy6rPNJb1GKwqz8SfO6dEttQDm86VNYZ2+VcMlk7aICoZ3mHph/cGbhqJsAOMuZZb6LhdloGO5Oh0dQ6SOSA9UG8JePjCipw4KwZJGx0KFxpFQflYBWf8/p8 /xU+MDec 8pjr2R7pNxvs8AKO5miq3HdWUxnyCOQJuXGfDoCMcMEa71oKb5yLqCD+poFFANrDGcQSslK0qspoJW8AgTN9cNs9R2+iU0LIzntIj6yNQe45+22R09B5Tbt7g2mdJWTBJxr/6xE5msWfSQX71Gf+mRIgECzkO1Q+5gTBAGqbiDJVdcoX3MTClmkh8qPzucfIoPveKy7Gbp6ffb/Ey52bp+XjmJcat3hAcCN1q 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: List-Subscribe: List-Unsubscribe: David Howells wrote on Wed, Jan 03, 2024 at 02:59:28PM +0000: > Always update remote_i_size in v9fs_stat2inode*() if the size is available, > even if we are asked not to update i_isize Sorry -- hold on for this patch, let's drop it for now and take it more slowly through next cycle. I had mostly forgotten about V9FS_STAT2INODE_KEEP_ISIZE and not paying enough attention yesterday evening, but it's not innocent -- I assume netfs will do the right thing if we update the *remote* i_size when there is cached data, but the inode's i_size cannot be updated as easily. It's hard to notice because the comment got split in 5e3cc1ee1405a7 ("9p: use inode->i_lock to protect i_size_write() under 32-bit"), but v9fs_refresh_inode* still have it: /* * We don't want to refresh inode->i_size, * because we may have cached data */ I assume refreshing i_size at a bad time would act like a truncation of cached memory. (To answer the other thread's comment that v9fs_i_size_write is useless; it's far from obvious enough but I'm afraid it is needed: - include/linux/fs.h has a comment saying i_size_write does need locking around it for 32bit to avoid breaking i_size_seqcount; that's still true in today's tree. - we could use any lock as long as it's coherent within the 9p subsystem, but we don't need a whole mutex so i_lock it is.) -- Dominique Martinet | Asmadeus