Linux EXT4 FS development
 help / color / mirror / Atom feed
From: "Theodore Tso" <tytso@mit.edu>
To: Zhang Yi <yi.zhang@huaweicloud.com>
Cc: sashiko-reviews@lists.linux.dev, linux-ext4@vger.kernel.org
Subject: Re: [PATCH v4 9/9] ext4: protect WRITE_ZEROES written extents with orphan list
Date: Thu, 23 Jul 2026 12:31:26 -0400	[thread overview]
Message-ID: <amJAxFjWXiSzjNd7@mit.edu> (raw)
In-Reply-To: <6213263f-27e4-4d2a-b6ef-f63093f89e69@huaweicloud.com>

On Thu, Jul 23, 2026 at 11:29:44AM -0500, Zhang Yi wrote:
> Therefore, I think the correct approach is to modify
> ext4_convert_unwritten_extents() so that it returns the actual
> conversion length, and only returns an error code when no conversion has
> taken place at all. This way, ext4_alloc_file_blocks() can use the
> returned conversion length to decide whether to add the orphan list
> (within the same handle as the conversion operation).
> 
> What do you think?

Yes, that makes sense.

I've checked the challers of ext4_alloc_file_blocks(), and at the
moment, in the case where there is a partial allocation, we return the
error, not the number of partially allocated files.  But given that
the callers are doing fallocate() that seems to be fine.

I'd suggest we should explicit about documenting how
ext4_alloc_file_blocks() will handle partial allocations before it
runs into an problem, so it's helpful for future people who are making
changes here.

Thanks,

						- Ted

  reply	other threads:[~2026-07-23 16:32 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-14  8:00 [PATCH v4 0/9] ext4: fix unaligned edge handling in FALLOC_FL_WRITE_ZEROES Zhang Yi
2026-07-14  8:00 ` [PATCH v4 1/9] ext4: use FGP_WRITEBEGIN for tail block zeroing Zhang Yi
2026-07-14  8:00 ` [PATCH v4 2/9] ext4: skip tail block zeroing for inline data files Zhang Yi
2026-07-14 15:09   ` Jan Kara
2026-07-14  8:00 ` [PATCH v4 3/9] ext4: check return value of ext4_get_block() in ext4_load_tail_bh() Zhang Yi
2026-07-14  8:00 ` [PATCH v4 4/9] ext4: move partial block zeroing earlier in ext4_zero_range() Zhang Yi
2026-07-14  8:00 ` [PATCH v4 5/9] ext4: clarify return semantics of ext4_load_tail_bh() Zhang Yi
2026-07-14  8:00 ` [PATCH v4 6/9] ext4: track partial-zero outcome per edge in ext4_zero_partial_blocks() Zhang Yi
2026-07-14  8:00 ` [PATCH v4 7/9] ext4: zero out whole block for clean edges in WRITE_ZEROES Zhang Yi
2026-07-14  8:00 ` [PATCH v4 8/9] ext4: write back partial-zeroed " Zhang Yi
2026-07-14  8:00 ` [PATCH v4 9/9] ext4: protect WRITE_ZEROES written extents with orphan list Zhang Yi
     [not found]   ` <20260714084203.971381F000E9@smtp.kernel.org>
2026-07-22 17:07     ` Theodore Tso
2026-07-23  3:29       ` Zhang Yi
2026-07-23 16:31         ` Theodore Tso [this message]
2026-07-23 13:08 ` [PATCH v4 0/9] ext4: fix unaligned edge handling in FALLOC_FL_WRITE_ZEROES Theodore Ts'o

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=amJAxFjWXiSzjNd7@mit.edu \
    --to=tytso@mit.edu \
    --cc=linux-ext4@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=yi.zhang@huaweicloud.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