mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/5] gfs2: handle errors from __filemap_get_folio() with FGP_CREAT in gfs2_getbuf() and its caller chain
@ 2026-09-08 21:16 Mauricio Faria de Oliveira
  2026-09-08 21:16 ` [PATCH 1/5] gfs2: handle errors from __filemap_get_folio() with FGP_CREAT in gfs2_getbuf() Mauricio Faria de Oliveira
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Mauricio Faria de Oliveira @ 2026-09-08 21:16 UTC (permalink / raw)
  To: Andreas Gruenbacher
  Cc: kernel-dev, gfs2, linux-kernel, Mauricio Faria de Oliveira

Currently, gfs2_getbuf() will hit a kernel oops for dereferencing an error
pointer if __filemap_get_folio() with FGP_CREAT fails, eg ERR_PTR(-ENOMEM),
as there is no error handling in this case.

The code and documentation in filemap.c and pagemap.h show that it indeed
may fail, and other callers in the kernel check for errors with FGP_CREAT.

This series adds such error handling in gfs2_getbuf() and its caller chain.

Tested with fstests on v7.3-rc1. It "Failed 51 out 788 tests" consistently,
plus one (different) flaky test on ~10 runs before and after this series.

Thanks,

Signed-off-by: Mauricio Faria de Oliveira <mfo@igalia.com>
---
Mauricio Faria de Oliveira (5):
      gfs2: handle errors from __filemap_get_folio() with FGP_CREAT in gfs2_getbuf()
      gfs2: handle NULL return value in callers of gfs2_getbuf() with CREATE
      gfs2: handle NULL return value in callers of gfs2_meta_new()
      gfs2: handle NULL return value in callers of gfs2_meta_ra()
      gfs2: check for errors from filemap_get_folio() in gfs2_jhead_process_page()

 fs/gfs2/bmap.c     | 27 +++++++++++++++++++--------
 fs/gfs2/dir.c      |  8 ++++++++
 fs/gfs2/inode.c    | 20 +++++++++++++++-----
 fs/gfs2/lops.c     | 31 ++++++++++++++++++++++++++-----
 fs/gfs2/meta_io.c  | 30 +++++++++++++++++++++++-------
 fs/gfs2/recovery.c |  2 ++
 fs/gfs2/xattr.c    |  6 ++++++
 7 files changed, 99 insertions(+), 25 deletions(-)
---
base-commit: cee9395acd8043be0644b25c34bfa86623f2b935
change-id: 20260908-gfs2_getbuf-error-checks-e8f89a08acc4

Best regards,
-- 
Mauricio Faria de Oliveira <mfo@igalia.com>


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

end of thread, other threads:[~2026-09-08 21:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-08 21:16 [PATCH 0/5] gfs2: handle errors from __filemap_get_folio() with FGP_CREAT in gfs2_getbuf() and its caller chain Mauricio Faria de Oliveira
2026-09-08 21:16 ` [PATCH 1/5] gfs2: handle errors from __filemap_get_folio() with FGP_CREAT in gfs2_getbuf() Mauricio Faria de Oliveira
2026-09-08 21:16 ` [PATCH 2/5] gfs2: handle NULL return value in callers of gfs2_getbuf() with CREATE Mauricio Faria de Oliveira
2026-09-08 21:16 ` [PATCH 3/5] gfs2: handle NULL return value in callers of gfs2_meta_new() Mauricio Faria de Oliveira
2026-09-08 21:16 ` [PATCH 4/5] gfs2: handle NULL return value in callers of gfs2_meta_ra() Mauricio Faria de Oliveira
2026-09-08 21:16 ` [PATCH 5/5] gfs2: check for errors from filemap_get_folio() in gfs2_jhead_process_page() Mauricio Faria de Oliveira

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®