From patchwork Wed Jan 3 14:59:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13510163 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 67486C47073 for ; Wed, 3 Jan 2024 15:00:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E87BD6B02E6; Wed, 3 Jan 2024 10:00:14 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E10156B02EC; Wed, 3 Jan 2024 10:00:14 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C633A6B02EB; Wed, 3 Jan 2024 10:00:14 -0500 (EST) 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 AD9756B02E6 for ; Wed, 3 Jan 2024 10:00:14 -0500 (EST) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 89A1C12092B for ; Wed, 3 Jan 2024 15:00:14 +0000 (UTC) X-FDA: 81638310348.15.33CDA0F Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf19.hostedemail.com (Postfix) with ESMTP id 79D7A1A0027 for ; Wed, 3 Jan 2024 15:00:12 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=PKcc3oFd; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf19.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1704294012; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=l/klC/ghutWIOc1+EVzXLrxXcGHqt0/sieVr6S5RVKE=; b=i11J86ToHllfSF8A/b6QqBe8W3DiyL0CwvNnmVtNxuurS+kHGiCvsogS7FSQNGgoCumtC8 LRMoaFfxB9YL52KjeMHIJ+B1fUaggDeoMQj0OHT/1W4oIdzqKTVD4l8gNktWFHBZhmNYiy bR6tgP0KObPr19JiqODtFYtPdTcdLiY= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=PKcc3oFd; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf19.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1704294012; a=rsa-sha256; cv=none; b=I8KmmddyNBTTdmDbSA0JyJMhAEhEmHk3jgeekOHXy5GSkqq7zOOyHpxuFbf32QwxF85XrV ivO861yXRX7PT391DmG5oC2xVEhwpfXmJe69tBVHubjk5ci/8HDMaNKY8iiZaEd09xQoW5 ek1kXEJ/voD1k6mxvcvAl9UiUHaUS4s= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704294011; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=l/klC/ghutWIOc1+EVzXLrxXcGHqt0/sieVr6S5RVKE=; b=PKcc3oFdjtuJktPx/Q9JV6aDZd72LiH+YYZzgii44amt9wGCPsNJJ77T6z8PSIOEUf5KUQ g/Zos1dJKtCGWRrOsutw5Y/KcoVXKRbk6nzZ0pkT2VShd+HMypjiVg+Pl8tNZeecGdDxh1 ab2GRXfpeeaNlhRKUvwn+3TGFVXeSiw= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-14-L2AWb4usNJ6xafig_4JuOw-1; Wed, 03 Jan 2024 10:00:08 -0500 X-MC-Unique: L2AWb4usNJ6xafig_4JuOw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4C7D38F4126; Wed, 3 Jan 2024 15:00:06 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2DFEE2026D66; Wed, 3 Jan 2024 15:00:03 +0000 (UTC) From: David Howells To: Christian Brauner , Jeff Layton , Gao Xiang , Dominique Martinet Cc: David Howells , 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: [PATCH 4/5] 9p: Always update remote_i_size in stat2inode Date: Wed, 3 Jan 2024 14:59:28 +0000 Message-ID: <20240103145935.384404-5-dhowells@redhat.com> In-Reply-To: <20240103145935.384404-1-dhowells@redhat.com> References: <20240103145935.384404-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: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i0AkAomxbv7cR5C8I6wrfeYUkQSc+19e+GVjZA93T1mRedB3UOf1Jd5Tq Mogwemz9 oKfGeFljFhzFpseH8RCFqXiFps5/u4ui5xldSNrOTcCaALzMmq1R0HvUEd23MVQ9e0MwHle7TdP5C9LWhGL9NJFEMSJbI0Pd7oODjbd36XrkPv225/hQkULgx/aW/fvIMqimsjQhyYFMOfrsR3vBMXnN90AQXtFSDboCDGfx+RlkjxpM0NeGlQ4sp5UCfHpHBYGEYM6Off5T/BYdwx3Hev93/ypIJLfw2ClbU0QuEFwNIr1lAo+JHs6cd/I6bT3BAHg/fPtbpB+xm5iFOyrPyfyaidnlvtgjZzF4SZICECi9qVP/qTmFlgRtfVUzTxOANSYJOoG6YJFb964SCC9jtPkMGPagmz8iA9vgOqWli15ecr4Y/48r64WmZqr+DpFOkOaY0/BA74yDpImz0sipspX09bynaV5f+5W8NT+IHkK2mwBHvm2CdG8R54XYluZscjYxbsobssIcipNY= 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: Always update remote_i_size in v9fs_stat2inode*() if the size is available, even if we are asked not to update i_isize Suggested-by: Dominique Martinet Link: https://lore.kernel.org/r/ZZVctju5TEjS218p@codewreck.org/ Signed-off-by: David Howells cc: Eric Van Hensbergen cc: Latchesar Ionkov cc: Christian Schoenebeck cc: v9fs@lists.linux.dev cc: linux-cachefs@redhat.com cc: linux-fsdevel@vger.kernel.org --- fs/9p/vfs_inode_dotl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/9p/vfs_inode_dotl.c b/fs/9p/vfs_inode_dotl.c index 3505227e1704..aa3a77bb5e86 100644 --- a/fs/9p/vfs_inode_dotl.c +++ b/fs/9p/vfs_inode_dotl.c @@ -684,10 +684,10 @@ v9fs_stat2inode_dotl(struct p9_stat_dotl *stat, struct inode *inode, mode |= inode->i_mode & ~S_IALLUGO; inode->i_mode = mode; } - if (!(flags & V9FS_STAT2INODE_KEEP_ISIZE) && - stat->st_result_mask & P9_STATS_SIZE) { + if (stat->st_result_mask & P9_STATS_SIZE) { v9inode->netfs.remote_i_size = stat->st_size; - v9fs_i_size_write(inode, stat->st_size); + if (!(flags & V9FS_STAT2INODE_KEEP_ISIZE)) + v9fs_i_size_write(inode, stat->st_size); } if (stat->st_result_mask & P9_STATS_BLOCKS) inode->i_blocks = stat->st_blocks;