gfs2 filesystem and dlm development
 help / color / mirror / Atom feed
* [bug report] gfs2: Convert gfs2_jhead_process_page() to use a folio
@ 2023-10-12  9:43 Dan Carpenter
  2023-10-12 15:27 ` Matthew Wilcox
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2023-10-12  9:43 UTC (permalink / raw)
  To: willy; +Cc: gfs2

Hello Matthew Wilcox (Oracle),

The patch 240159077d00: "gfs2: Convert gfs2_jhead_process_page() to
use a folio" from May 13, 2022 (linux-next), leads to the following
Smatch static checker warning:

	fs/gfs2/lops.c:485 gfs2_jhead_process_page()
	error: 'folio' dereferencing possible ERR_PTR()

fs/gfs2/lops.c
    469 static void gfs2_jhead_process_page(struct gfs2_jdesc *jd, unsigned long index,
    470                                     struct gfs2_log_header_host *head,
    471                                     bool *done)
    472 {
    473         struct folio *folio;
    474 
    475         folio = filemap_get_folio(jd->jd_inode->i_mapping, index);

Does filemap_get_folio() need to be checked for errors?

    476 
    477         folio_wait_locked(folio);
    478         if (folio_test_error(folio))
    479                 *done = true;
    480 
    481         if (!*done)
    482                 *done = gfs2_jhead_pg_srch(jd, head, &folio->page);
    483 
    484         /* filemap_get_folio() and the earlier grab_cache_page() */
--> 485         folio_put_refs(folio, 2);
    486 }

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-10-13  6:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-12  9:43 [bug report] gfs2: Convert gfs2_jhead_process_page() to use a folio Dan Carpenter
2023-10-12 15:27 ` Matthew Wilcox
2023-10-13  6:28   ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox