The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: Christian Schoenebeck <linux_oss@crudebyte.com>
Cc: dhowells@redhat.com, ericvh@kernel.org, lucho@ionkov.net,
	asmadeus@codewreck.org, Pierre Barre <pierre@barre.sh>,
	v9fs@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] 9p: fix data corruption with writeback caching during concurrent stat
Date: Wed, 18 Feb 2026 14:04:24 +0000	[thread overview]
Message-ID: <1643438.1771423464@warthog.procyon.org.uk> (raw)
In-Reply-To: <2393940.ElGaqSPkdT@weasel>

Christian Schoenebeck <linux_oss@crudebyte.com> wrote:

> > -			int retval = filemap_fdatawrite(inode->i_mapping);
> > +			int retval = filemap_write_and_wait(inode->i_mapping);
> 
> Haven't reviewed thorougly, but this looks wrong to me. The point about write-
> back is not having to wait for completion.

You should do this if AT_STATX_FORCE_SYNC is set and otherwise not if
AT_STATX_DONT_SYNC is set.

> > +	v9fs_stat2inode(st, d_inode(dentry), dentry->d_sb,
> > +		(v9ses->cache & CACHE_WRITEBACK) ? V9FS_STAT2INODE_KEEP_ISIZE : 0);
> 
> And this measure alone (along with the same change in v9fs_vfs_getattr_dotl()
> that is) would not fix the misbehavior you encountered?

As mentioned in response to v2, I think this is the wrong approach and that
you should compare the retrieved stat->length to ->netfs.remote_i_size and not
update ->i_size if there was no change.  Ideally you'd also compare mtime too,
but you don't know what mtime changed to:-/.

David


  parent reply	other threads:[~2026-02-18 14:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-27  8:37 [PATCH] 9p: fix data corruption with writeback caching during concurrent stat Pierre Barre
2025-12-27 11:30 ` Christian Schoenebeck
2025-12-27 17:58   ` Pierre Barre
2026-02-18 14:04   ` David Howells [this message]
2026-02-18 16:31 ` David Howells

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1643438.1771423464@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=asmadeus@codewreck.org \
    --cc=ericvh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux_oss@crudebyte.com \
    --cc=lucho@ionkov.net \
    --cc=pierre@barre.sh \
    --cc=v9fs@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox