Re: [PATCH v4 9/9] ext4: protect WRITE_ZEROES written extents with orphan list

Zhang Yi <[email protected]> Mon, 27 Jul 2026 14:10:03 +0800
Newsgroups org.kernel.vger.linux-ext4,dev.linux.lists.sashiko-reviews
Message-ID <[email protected]>
On 7/24/2026 12:31 AM, Theodore Tso wrote:
> 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.
> 

Sure, I'll add this document as well.

Thanks,
Yi.