Re: [PATCH v4 3/7] hfsplus: take the bitmap page lock for allocate/free

From: Christoph Hellwig

Date: Fri Sep 18 2026 - 09:37:39 EST


On Mon, Sep 14, 2026 at 04:39:37PM -0700, Viacheslav Dubeyko wrote:
> The hfsplus_block_allocate() and hfsplus_block_free() kmap
> the allocation bitmap's pages and modify their bits in place
> under sbi->alloc_mutex, but without holding the page lock.
> That leaves the read-modify-write of the bitmap bits
> unprotected against a concurrent writeback of the same page,
> which can read a partially-updated bitmap word or race with
> the dirty-bit update.

Looks good:

Reviewed-by: Christoph Hellwig <hch@xxxxxx>

> + lock_page(page);
> + folio_wait_writeback(page_folio(page));
> pptr = kmap_local_page(page);

Although this really begs for a folio conversion rather sooner than
later.