+ mm-filemap-remove-hugetlb-special-casing-in-filemapc-fix.patch added to mm-unstable branch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: hugetlbfs: fix an NULL vs IS_ERR() bug
has been added to the -mm mm-unstable branch.  Its filename is
     mm-filemap-remove-hugetlb-special-casing-in-filemapc-fix.patch

This patch will shortly appear at
     https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-filemap-remove-hugetlb-special-casing-in-filemapc-fix.patch

This patch will later appear in the mm-unstable branch at
    git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days

------------------------------------------------------
From: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Subject: hugetlbfs: fix an NULL vs IS_ERR() bug
Date: Thu, 28 Sep 2023 08:17:36 +0300

This code was converted from using find_lock_page() which returns NULL,
to calling filemap_lock_hugetlb_folio() which returns -ENOENT.  The
check needs to be updated to match.  Also IS_ERR() has an unlikely()
built in so we can remove that.

Link: https://lkml.kernel.org/r/1772c296-1417-486f-8eef-171af2192681@moroto.mountain
Fixes: 4649d8d5bb81 ("mm/filemap: remove hugetlb special casing in filemap.c")
Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Reviewed-by: Sidhartha Kumar <sidhartha.kumar@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 fs/hugetlbfs/inode.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/hugetlbfs/inode.c~mm-filemap-remove-hugetlb-special-casing-in-filemapc-fix
+++ a/fs/hugetlbfs/inode.c
@@ -354,7 +354,7 @@ static ssize_t hugetlbfs_read_iter(struc
 
 		/* Find the folio */
 		folio = filemap_lock_hugetlb_folio(h, mapping, index);
-		if (unlikely(folio == NULL)) {
+		if (IS_ERR(folio)) {
 			/*
 			 * We have a HOLE, zero out the user-buffer for the
 			 * length of the hole or request.
_

Patches currently in -mm which might be from dan.carpenter@xxxxxxxxxx are

mm-filemap-remove-hugetlb-special-casing-in-filemapc-fix.patch




[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux