Re: [PATCH v4, RESEND] fs/dax: check zero or empty entry before converting xarray entry

From: Andrew Morton

Date: Thu Jul 30 2026 - 14:59:59 EST


On Thu, 30 Jul 2026 14:12:55 +0100 Seunguk Shin <seunguk.shin@xxxxxxx> wrote:

> dax_associate_entry(), dax_disassociate_entry(), and dax_busy_page()
> call dax_to_folio(entry) before checking whether entry is a zero or
> empty xarray entry.
>
> That ordering is wrong because zero and empty entries are not folio
> entries. Commit 98c183a4fccf ("fs/dax: don't disassociate zero page
> entries") added guards in the associate and disassociate paths, but the
> guards still come after dax_to_folio(entry), and dax_busy_page() still
> has the same problem.

Are there any known userspace-visible runtime effects of this?

If so, please fully describe them in the changelog. If not, please
also mention that.

This is important information for deciding which kernel(s) need the
patch.

> Move the zero/empty checks before dax_to_folio(entry) in all three helpers.

Thanks.