public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Long Li <leo.lilong@huawei.com>
To: Brian Foster <bfoster@redhat.com>
Cc: Dave Chinner <david@fromorbit.com>, <brauner@kernel.org>,
	<djwong@kernel.org>, <cem@kernel.org>,
	<linux-xfs@vger.kernel.org>, <linux-fsdevel@vger.kernel.org>,
	<yi.zhang@huawei.com>, <houtao1@huawei.com>,
	<yangerkun@huawei.com>
Subject: Re: [PATCH v5 1/2] iomap: fix zero padding data issue in concurrent append writes
Date: Thu, 5 Dec 2024 20:47:14 +0800	[thread overview]
Message-ID: <Z1Gg0pAa54MoeYME@localhost.localdomain> (raw)
In-Reply-To: <Z1BIab8G3KmXuyfS@bfoster>

On Wed, Dec 04, 2024 at 07:17:45AM -0500, Brian Foster wrote:
> > Coming back to our current issue, during writeback mapping, we sample
> > the inode size to determine if the ioend is within EOF and attempt to
> > trim io_size. Concurrent truncate operations may update the inode size,
> > causing the pos of write back beyond EOF. In such cases, we simply don't
> > trim io_size, which seems like a viable approach.
> > 
> 
> Perhaps. I'm not claiming it isn't functional. But to Dave's (more
> elaborated) point and in light of the racy i_size issue you've
> uncovered, what bugs me also about this is that this creates an internal
> inconsistency in the submission codepath.
> 
> I.e., the top level code does one thing based on one value of i_size,
> then the ioend construction does another, and the logic is not directly
> correlated so there is no real guarantee changes in one area correlate
> to the other. IME, this increases potential for future bugs and adds
> maintenance burden.
> 
> A simple example to consider might be.. suppose sometime in the future
> we determine there is a selective case where we do want to allow a
> post-eof writeback. As of right now, all that really requires is
> adjustment to the "handle_eof()" logic and the rest of the codepath does
> the right thing agnostic to outside operations like truncate. I think
> there's value if we can preserve that invariant going forward.
> 
> FWIW, I'm not objecting to the alternative if something in the above
> reasoning is wrong. I'm just trying to prioritize keeping things simple
> and maintainable, particularly since truncate is kind of a complicated
> beast as it is.
> 
> Brian
> 

Yes, I agree with you, thanks for the detailed explanation.

Thanks,
Long Li

      reply	other threads:[~2024-12-05 12:49 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-27  6:35 [PATCH v5 1/2] iomap: fix zero padding data issue in concurrent append writes Long Li
2024-11-27  6:35 ` [PATCH v5 2/2] xfs: clean up xfs_end_ioend() to reuse local variables Long Li
2024-11-27 16:07   ` Darrick J. Wong
2024-11-27 16:28 ` [PATCH v5 1/2] iomap: fix zero padding data issue in concurrent append writes Darrick J. Wong
2024-11-28  6:38   ` Long Li
2024-11-28  3:33 ` Christoph Hellwig
2024-11-30 13:39 ` Long Li
2024-12-02 15:26   ` Brian Foster
2024-12-03  2:08     ` Dave Chinner
2024-12-03 14:54       ` Brian Foster
2024-12-03 21:12         ` Dave Chinner
2024-12-04 12:05           ` Brian Foster
2024-12-04  9:06         ` Long Li
2024-12-04 12:05           ` Brian Foster
2024-12-06  3:36             ` Long Li
2024-12-04  9:00       ` Long Li
2024-12-04 12:17         ` Brian Foster
2024-12-05 12:47           ` Long Li [this message]

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=Z1Gg0pAa54MoeYME@localhost.localdomain \
    --to=leo.lilong@huawei.com \
    --cc=bfoster@redhat.com \
    --cc=brauner@kernel.org \
    --cc=cem@kernel.org \
    --cc=david@fromorbit.com \
    --cc=djwong@kernel.org \
    --cc=houtao1@huawei.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=yangerkun@huawei.com \
    --cc=yi.zhang@huawei.com \
    /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