From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dave Kleikamp Date: Thu, 30 Mar 2023 11:50:11 -0500 Subject: [Cluster-devel] [PATCH v2 10/19] jfs: logmgr: use __bio_add_page to add single page to bio In-Reply-To: <820f11140138c2deb4a649014556aef27474c13b.1680172791.git.johannes.thumshirn@wdc.com> References: <820f11140138c2deb4a649014556aef27474c13b.1680172791.git.johannes.thumshirn@wdc.com> Message-ID: <8f08c42d-268a-b608-1ee2-dad74e26cb28@oracle.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On 3/30/23 5:43AM, Johannes Thumshirn wrote: > The JFS IO code uses bio_add_page() to add a page to a newly created bio. > bio_add_page() can fail, but the return value is never checked. > > Use __bio_add_page() as adding a single page to a newly created bio is > guaranteed to succeed. > > This brings us a step closer to marking bio_add_page() as __must_check. > > Signed-off-by: Johannes Thumshirn > Reviewed-by: Damien Le Moal Acked-by: Dave Kleikamp > --- > fs/jfs/jfs_logmgr.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/fs/jfs/jfs_logmgr.c b/fs/jfs/jfs_logmgr.c > index 695415cbfe98..15c645827dec 100644 > --- a/fs/jfs/jfs_logmgr.c > +++ b/fs/jfs/jfs_logmgr.c > @@ -1974,7 +1974,7 @@ static int lbmRead(struct jfs_log * log, int pn, struct lbuf ** bpp) > > bio = bio_alloc(log->bdev, 1, REQ_OP_READ, GFP_NOFS); > bio->bi_iter.bi_sector = bp->l_blkno << (log->l2bsize - 9); > - bio_add_page(bio, bp->l_page, LOGPSIZE, bp->l_offset); > + __bio_add_page(bio, bp->l_page, LOGPSIZE, bp->l_offset); > BUG_ON(bio->bi_iter.bi_size != LOGPSIZE); > > bio->bi_end_io = lbmIODone; > @@ -2115,7 +2115,7 @@ static void lbmStartIO(struct lbuf * bp) > > bio = bio_alloc(log->bdev, 1, REQ_OP_WRITE | REQ_SYNC, GFP_NOFS); > bio->bi_iter.bi_sector = bp->l_blkno << (log->l2bsize - 9); > - bio_add_page(bio, bp->l_page, LOGPSIZE, bp->l_offset); > + __bio_add_page(bio, bp->l_page, LOGPSIZE, bp->l_offset); > BUG_ON(bio->bi_iter.bi_size != LOGPSIZE); > > bio->bi_end_io = lbmIODone;