[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAHpGcMJ4HTSRzqEWpVDDZi66Y86LRKCob9PAkMFfZBWdpUDU5w@mail.gmail.com>
Date: Wed, 12 Mar 2025 13:06:13 +0100
From: Andreas Grünbacher <andreas.gruenbacher@...il.com>
To: Dan Carpenter <dan.carpenter@...aro.org>
Cc: Matthew Wilcox <willy@...radead.org>, Andreas Gruenbacher <agruenba@...hat.com>, gfs2@...ts.linux.dev,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH next] gfs2: Fix a NULL vs IS_ERR() bug in gfs2_find_jhead()
Am Mi., 12. März 2025 um 09:33 Uhr schrieb Dan Carpenter
<dan.carpenter@...aro.org>:
> The filemap_grab_folio() function doesn't return NULL, it returns error
> pointers. Fix the check to match.
>
> Fixes: 40829760096d ("gfs2: Convert gfs2_find_jhead() to use a folio")
> Signed-off-by: Dan Carpenter <dan.carpenter@...aro.org>
> ---
> fs/gfs2/lops.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c
> index 3853c422040b..0fd3b5ec7d8c 100644
> --- a/fs/gfs2/lops.c
> +++ b/fs/gfs2/lops.c
> @@ -530,8 +530,8 @@ int gfs2_find_jhead(struct gfs2_jdesc *jd, struct gfs2_log_header_host *head,
> if (!folio) {
> folio = filemap_grab_folio(mapping,
> block >> shift);
> - if (!folio) {
> - ret = -ENOMEM;
> + if (IS_ERR(folio)) {
> + ret = PTR_ERR(folio);
> done = true;
> goto out;
> }
> --
> 2.47.2
Applied, thanks.
Andreas
Powered by blists - more mailing lists