Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp7172973rdb; Wed, 3 Jan 2024 07:01:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IGGiQnZhvQVvS+Elq+3iRX/yPWpYxtQWwA07BQJ7GSP5UNyA6rR75Oh9u1sSutZtN3ztm0Z X-Received: by 2002:a50:9ea4:0:b0:54c:75eb:f8b1 with SMTP id a33-20020a509ea4000000b0054c75ebf8b1mr11595809edf.7.1704294115637; Wed, 03 Jan 2024 07:01:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704294115; cv=none; d=google.com; s=arc-20160816; b=lMYKL4I8a7c7KIjxVSvbfy68M/t7I3R/d68TbQ/Hu9U6eD/FiNun/iiIwNbuKaK5JE nUGSB7Wap3j+3QumggsO+1JrqH6VXRHHw1aPVJ7nPT22jocMPvkg2UtEP85pP5NX1zuR qs0HpGt45Zzv5SrdhNMgItKSMLoehuJdz6JevoHAffi6DerG3vWY2Pm5n3UinJijbomb mzchk4lZIaKKOnyvqChy3TN2w3qOp01o51TXz4J7DRakjuHFKRx63VuZZWJcCivBBavj asuf1WZl3VFEyNu1pPGMtNTBH3AGmSnboS4+F+umkogkYNBjulQi1FApyZ7SMl9r3Fk/ +v0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=l/klC/ghutWIOc1+EVzXLrxXcGHqt0/sieVr6S5RVKE=; fh=z2lFNIQm1BYTiGQWz0rp4lP3BVSA1n5g+uZ/88gyKRg=; b=VQtLK6+VjNIryPqr3Sew5fLbsVHva1PWSfZwazyzRbDz72+RV+easB8hGcctOTAxjG zXMdrdEXx1/nv3FUA+gwsT71LvqkwpF6TrUqKIa9QYWyzF8nh+6cS6+msBvnI4ticwlB dWQXf5+CfWgpltod+H1O9/chTIu7/MLiJuuBb8P89yiGdYiSMiZ6nVqmQ6pPqGll0kxh mbfWMWbN9KkDXO0qVDAMmnNXuzPqC+omPXw/+06nRDFzrnBO8ToSMrxDKNAG6oU4IAzO ELR8sKLQ0uBjZ3R1qTpPo7VgXL4fjePmJByZ7KjMERuAVPfwKwsz9T6o2KmtMpjcRWAE TJ1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PKcc3oFd; spf=pass (google.com: domain of linux-nfs+bounces-884-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-nfs+bounces-884-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id u8-20020a50a408000000b00555a4c36976si5458221edb.500.2024.01.03.07.01.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 07:01:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-884-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PKcc3oFd; spf=pass (google.com: domain of linux-nfs+bounces-884-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-nfs+bounces-884-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 215DF1F216CC for ; Wed, 3 Jan 2024 15:01:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 052631CA9B; Wed, 3 Jan 2024 15:00:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="PKcc3oFd" X-Original-To: linux-nfs@vger.kernel.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 94ABD1B26E for ; Wed, 3 Jan 2024 15:00:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com 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> Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 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;