hulk inclusion category: bugfix bugzilla: https://atomgit.com/src-openeuler/kernel/issues/15219 CVE: CVE-2026-45899 -------------------------------- This reverts commit a3f90354c4db7ac2195ca93869ea61ea4893e7d8. Fixes: a3f90354c4db ("ext4: fix e4b bitmap inconsistency reports") Signed-off-by: Long Li <leo.lilong@huawei.com> --- fs/ext4/mballoc.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index cc2795a033c2..f8a3af10bab6 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -1710,17 +1710,16 @@ ext4_mb_load_buddy_gfp(struct super_block *sb, ext4_group_t group, /* we could use find_or_create_page(), but it locks page * what we'd like to avoid in fast path ... */ page = find_get_page_flags(inode->i_mapping, pnum, FGP_ACCESSED); - if (page == NULL || !PageUptodate(page) || PageLocked(page)) { - /* - * PageLocked is employed to detect ongoing page - * migrations, since concurrent migrations can lead to - * bitmap inconsistency. And if we are not uptodate that - * implies somebody just created the page but is yet to - * initialize it. We can drop the page reference and - * try to get the page with lock in both cases to avoid - * concurrency. - */ + if (page == NULL || !PageUptodate(page)) { if (page) + /* + * drop the page reference and try + * to get the page with lock. If we + * are not uptodate that implies + * somebody just created the page but + * is yet to initialize the same. So + * wait for it to initialize. + */ put_page(page); page = find_or_create_page(inode->i_mapping, pnum, gfp); if (page) { @@ -1761,7 +1760,7 @@ ext4_mb_load_buddy_gfp(struct super_block *sb, ext4_group_t group, poff = block % blocks_per_page; page = find_get_page_flags(inode->i_mapping, pnum, FGP_ACCESSED); - if (page == NULL || !PageUptodate(page) || PageLocked(page)) { + if (page == NULL || !PageUptodate(page)) { if (page) put_page(page); page = find_or_create_page(inode->i_mapping, pnum, gfp); -- 2.52.0