Skip to contentSkip to conversation

gfs2: Use bio_add_folio_nofail()

PATCH In review Matthew Wilcox (Oracle) 2 participants 2 messages Nov 6, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gfs2: Use bio_add_folio_nofail()

As the label says, we've just allocated a new BIO so we know we can add this folio to it. We now have bio_add_folio_nofail() for this purpose.

---
 fs/gfs2/lops.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
fs/gfs2/lops.c +1 -2
index 9c8c305a75c4..233b3aa8edca 100644
@@ -562,8 +562,7 @@ int gfs2_find_jhead(struct gfs2_jdesc *jd, struct gfs2_log_header_host *head)
 			bio = gfs2_log_alloc_bio(sdp, dblock, gfs2_end_log_read);
 			bio->bi_opf = REQ_OP_READ;
 add_block_to_new_bio:
-			if (!bio_add_folio(bio, folio, bsize, off))
-				BUG();
+			bio_add_folio_nofail(bio, folio, bsize, off);
 block_added:
 			off += bsize;
 			if (off == folio_size(folio))
Signature · 1 line
2.47.2
#1 lore raw
Quoted 24 lines · Matthew Wilcox (Oracle)

As the label says, we've just allocated a new BIO so we know we can add this folio to it. We now have bio_add_folio_nofail() for this purpose.

---
 fs/gfs2/lops.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
fs/gfs2/lops.c +1 -3
index 9c8c305a75c4..233b3aa8edca 100644
@@ -562,8 +562,7 @@ int gfs2_find_jhead(struct gfs2_jdesc *jd, struct gfs2_log_header_host *head)
                        bio = gfs2_log_alloc_bio(sdp, dblock, gfs2_end_log_read);
                        bio->bi_opf = REQ_OP_READ;
 add_block_to_new_bio:
-                       if (!bio_add_folio(bio, folio, bsize, off))
-                               BUG();
+                       bio_add_folio_nofail(bio, folio, bsize, off);
 block_added:
                        off += bsize;
                        if (off == folio_size(folio))
--
Quoted 2 lines

2.47.2

Added, thanks.

Andreas