From: Naman Jain <namjain@linux.microsoft.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: Theodore Ts'o <tytso@mit.edu>,
Andreas Dilger <adilger.kernel@dilger.ca>,
Sasha Levin <sashal@kernel.org>,
stable@vger.kernel.org, linux-ext4@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 6.1] ext4: honor NULL returns from __filemap_get_folio()
Date: Mon, 2 Nov 2026 22:54:13 +0530 [thread overview]
Message-ID: <f81cdcf4-2e9c-404c-a698-448873b8edf5@linux.microsoft.com> (raw)
In-Reply-To: <aujDuxgeH-TyEsXh@casper.infradead.org>
On 11/2/2026 10:39 PM, Matthew Wilcox wrote:
> On Mon, Nov 02, 2026 at 04:33:41PM +0000, Naman Jain wrote:
>> The bitmap and buddy folio conversions assume that
>> __filemap_get_folio() returns error pointers. In Linux 6.1, however,
>> it returns NULL both when a non-creating lookup misses and when folio
>> creation fails.
>>
>> A cache miss therefore passes the IS_ERR() check and reaches
>> folio_test_uptodate(NULL) in ext4_mb_load_buddy_gfp(). Creating-lookup
>> failures can also dereference NULL in its slow paths and in
>> ext4_mb_get_buddy_page_lock().
>>
>> Restore NULL checks at all six lookup sites and return -ENOMEM when a
>> creating lookup fails. Preserve the folio locking and migration checks
>> without changing the global filemap API.
>>
>> Fixes: d34e4fd4e73f ("ext4: convert bd_bitmap_page to bd_bitmap_folio")
>> Fixes: 862483175d3d ("ext4: convert bd_buddy_page to bd_buddy_folio")
>> Cc: stable@vger.kernel.org # 6.1.x
>> Signed-off-by: Naman Jain <namjain@linux.microsoft.com>
>
> Elliot beat you to it:
>
> https://lore.kernel.org/linux-ext4/20261102-ext4-ntfs3-null-folio-v1-0-4fd91ee23a4a@elliotjb.com/
>
> Care to drop a R-b on his series?
Done.
I actually checked LKML in the morning for this :)
Regards,
Naman
prev parent reply other threads:[~2026-11-02 17:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-02 16:33 Naman Jain
2026-11-02 17:09 ` Matthew Wilcox
2026-11-02 17:24 ` Naman Jain [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=f81cdcf4-2e9c-404c-a698-448873b8edf5@linux.microsoft.com \
--to=namjain@linux.microsoft.com \
--cc=adilger.kernel@dilger.ca \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sashal@kernel.org \
--cc=stable@vger.kernel.org \
--cc=tytso@mit.edu \
--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
all inboxes | Powered by JetHome®