From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 23BA32FD698 for ; Wed, 18 Feb 2026 13:41:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771422098; cv=none; b=gug2YZuZVQcqEepi8l7lCnlxy77MxwWj22RQ4HXGW+OlnpfOSEapQUl/M3J1JsWsiPow78QWL1AqfYL3pBWF32HnZv3uimHbpZgQlENGTkMNq0P3+UN1aZID2e+XUXqhM++HESlISA+MAVcxfkfByfwEqsh7HYbQW8XQBHHJ6Ew= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771422098; c=relaxed/simple; bh=B3ZcPJM1yocHlcq7WsvfEhVBJtXJPaiq2VB14I2B/b8=; h=From:In-Reply-To:References:To:Cc:Subject:MIME-Version: Content-Type:Date:Message-ID; b=OxiWDUDCiS12haznfJ1i75GfDK9fwfj1+DschUCJULIEBKQfHVZUpUrJyYWJFtPnWGq2Jft1cDm3Ya0tR4WqWDHhJFnkl35ZpsIQcHxf31dkaxU9kfH6nzncw+2Q7c0Y5tr7ALIH7BOj058IYMW7NgQJ3AjGIxL6cu/aL+gMa3I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=auU/rb22; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="auU/rb22" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1771422096; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=B3ZcPJM1yocHlcq7WsvfEhVBJtXJPaiq2VB14I2B/b8=; b=auU/rb22oOj1/P1Q6WJsTUYWqtAgISDT0cM1A6NTy5lYnmEmoqOU+TK8IyTJPAWibl9mch WJE+kLoheOUs7pb8jCA1jYH8m0tw7rNYMv2lPiYPiifqvmBG/uPAHGv75d9fasvz6UHECA mZLmHcdSWqPdMRH27axGDUrnDOR8NzQ= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-423-nbp9YrhgMs2_bNi4rDFRbw-1; Wed, 18 Feb 2026 08:41:31 -0500 X-MC-Unique: nbp9YrhgMs2_bNi4rDFRbw-1 X-Mimecast-MFC-AGG-ID: nbp9YrhgMs2_bNi4rDFRbw_1771422089 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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 mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 879EB1955D4D; Wed, 18 Feb 2026 13:41:29 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.45.225.173]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B56861954115; Wed, 18 Feb 2026 13:41:26 +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: <1642497.1771421883@warthog.procyon.org.uk> References: <1642497.1771421883@warthog.procyon.org.uk> <20251227180137.730385-1-pierre@barre.sh> To: Pierre Barre Cc: dhowells@redhat.com, ericvh@kernel.org, lucho@ionkov.net, asmadeus@codewreck.org, linux_oss@crudebyte.com, v9fs@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] 9p: fix i_size update race in getattr with writeback caching Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1642565.1771422085.1@warthog.procyon.org.uk> Content-Transfer-Encoding: quoted-printable Date: Wed, 18 Feb 2026 13:41:25 +0000 Message-ID: <1642566.1771422085@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 David Howells wrote: > A better way is probably, in v9fs_stat2inode() and v9fs_stat2inode_dotl(= ), if > the inode isn't new, compare the values for stat->mtime to inode->i_mtim= e and > stat->length to v9inode->netfs.remote_i_size and if they differ mark the= inode > as being remotely modified, invalidate the pagecache and reset inode->i_= size. > = > If stat->mtime =3D=3D inode->i_mtime and stat->length =3D=3D > v9inode->netfs.remote_i_size, then don't alter inode->i_size. Also, you'd need to update remote_i_size upon successful completion of a w= rite RPC call to increase it up to the end of the write. David