Re: [PATCH] hfsplus: limit sb_maxbytes to partition size

Hyunchul Lee
2026-03-04T23:50:01Z

On Wed, Mar 04, 2026 at 05:08:15AM -0800, Christoph Hellwig wrote:
> On Tue, Mar 03, 2026 at 05:28:07PM +0900, Hyunchul Lee wrote:
> > s_maxbytes currently is set to MAX_LFS_FILESIZE,
> > which allows writes beyond the partition size.
>
> The "partition size" does not matter here. s_maxbytes is the maximum
> size supported by the format and has nothing to do with the actual space
> allocated to the file system (which in Linux terminology would be the
> block device and not the partition anyway).
>
> >
> > As a result,
> > large-offset writes on small partitions can fail late
> > with ENOSPC.
>
> That sounds like some other check is missing in hfsplus, but it
> should be about the available free space, not the device size.
>

When running xfs_io -c "pwrite 8t 512", hfsplus fills the block device
with zeros before returning ENOSPC. I was trying to fix this,
but as you mentioned, I will look for another solution.

Thank for your review and comments.

--
Thanks,
Hyunchul