From: Andrew Morton <akpm@linux-foundation.org>
To: Kiara Grouwstra <cinereal@riseup.net>
Cc: Dan Williams <djbw@kernel.org>,
Christian Brauner <brauner@kernel.org>,
Alexander Viro <viro@zeniv.linux.org.uk>,
Alistair Popple <apopple@nvidia.com>,
David Hildenbrand <david@kernel.org>, Jan Kara <jack@suse.cz>,
Matthew Wilcox <willy@infradead.org>,
linux-fsdevel@vger.kernel.org, nvdimm@lists.linux.dev,
linux-kernel@vger.kernel.org, Seunguk Shin <seunguk.shin@arm.com>
Subject: Re: [PATCH] fs/dax: get the folio of an entry only after the entry has one
Date: Tue, 1 Sep 2026 13:51:48 -0700 [thread overview]
Message-ID: <20260901135148.3f43c87fda6515a34541648e@linux-foundation.org> (raw)
In-Reply-To: <20260901195658.4027962-1-cinereal@riseup.net>
On Tue, 1 Sep 2026 21:56:58 +0200 Kiara Grouwstra <cinereal@riseup.net> wrote:
> dax_associate_entry(), dax_disassociate_entry() and dax_busy_page() each
> compute dax_to_folio(entry) in the declaration, one statement before the
> test that returns early when the entry is a zero entry or an empty entry.
> An empty entry holds no pfn, so dax_to_folio() reads vmemmap[0].
>
> Where the memory map starts at pfn 0 this reads a struct page that exists,
> the value is discarded, and nothing shows. Where the lowest present section
> is above pfn 0 there is no struct page for pfn 0 and the read faults.
> grab_mapping_entry() gives the first fault on a file an empty entry, so on
> such a machine every first DAX fault on a file ends in:
>
> BUG: unable to handle page fault for address: ffffea0000000008
> RIP: 0010:dax_to_folio+0x14/0x60
> dax_insert_entry+0xb2/0x3c0
> dax_fault_iter+0x200/0x600
> dax_iomap_pte_fault+0x193/0x3d0
>
> Found on a kernel that boots on one high region of system RAM, which has
> no struct page for the memory below it.
>
> Move each call after the early return. The other callers of dax_to_folio()
> in this file already only run for an entry that holds a pfn.
>
Thanks. This is near-identical to
https://lore.kernel.org/all/m2y0enxtzk.fsf@arm.com/, which I have
queued for 7.3-rcX, with cc:stable.
Seunguk's fix was set a month ago, but balls were dropped :(
prev parent reply other threads:[~2026-09-01 20:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-01 19:56 [PATCH] fs/dax: get the folio of an entry only after the entry has one Kiara Grouwstra
2026-09-01 20:51 ` Andrew Morton [this message]
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=20260901135148.3f43c87fda6515a34541648e@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=apopple@nvidia.com \
--cc=brauner@kernel.org \
--cc=cinereal@riseup.net \
--cc=david@kernel.org \
--cc=djbw@kernel.org \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nvdimm@lists.linux.dev \
--cc=seunguk.shin@arm.com \
--cc=viro@zeniv.linux.org.uk \
--cc=willy@infradead.org \
/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