On Tue, Apr 22, 2025 at 4:27 PM Christoph Hellwig <h...@lst.de> wrote: > > Use the bio_add_virt_nofail to add a single kernel virtual address > to a bio as that can't fail. > > Signed-off-by: Christoph Hellwig <h...@lst.de> Acked-by: Jack Wang <jinpu.w...@ionos.com> > --- > drivers/block/rnbd/rnbd-srv.c | 7 +------ > 1 file changed, 1 insertion(+), 6 deletions(-) > > diff --git a/drivers/block/rnbd/rnbd-srv.c b/drivers/block/rnbd/rnbd-srv.c > index 2ee6e9bd4e28..2df8941a6b14 100644 > --- a/drivers/block/rnbd/rnbd-srv.c > +++ b/drivers/block/rnbd/rnbd-srv.c > @@ -147,12 +147,7 @@ static int process_rdma(struct rnbd_srv_session > *srv_sess, > > bio = bio_alloc(file_bdev(sess_dev->bdev_file), 1, > rnbd_to_bio_flags(le32_to_cpu(msg->rw)), GFP_KERNEL); > - if (bio_add_page(bio, virt_to_page(data), datalen, > - offset_in_page(data)) != datalen) { > - rnbd_srv_err_rl(sess_dev, "Failed to map data to bio\n"); > - err = -EINVAL; > - goto bio_put; > - } > + bio_add_virt_nofail(bio, data, datalen); > > bio->bi_opf = rnbd_to_bio_flags(le32_to_cpu(msg->rw)); > if (bio_has_data(bio) && > -- > 2.47.2 >
- [PATCH 07/17] bcache: use bio_add_virt_nofail Christoph Hellwig
- Re: [PATCH 07/17] bcache: use bio_add_virt_nofail Damien Le Moal
- Re: [PATCH 07/17] bcache: use bio_add_virt_nofail Johannes Thumshirn
- [PATCH 09/17] dm-integrity: use bio_add_virt_nofail Christoph Hellwig
- Re: [PATCH 09/17] dm-integrity: use bio_add_virt_n... Damien Le Moal
- Re: [PATCH 09/17] dm-integrity: use bio_add_virt_n... Johannes Thumshirn
- [PATCH 10/17] rnbd-srv: use bio_add_virt_nofail Christoph Hellwig
- Re: [PATCH 10/17] rnbd-srv: use bio_add_virt_nofai... Damien Le Moal
- Re: [PATCH 10/17] rnbd-srv: use bio_add_virt_nofai... Damien Le Moal
- Re: [PATCH 10/17] rnbd-srv: use bio_add_virt_nofai... Jinpu Wang
- Re: [PATCH 10/17] rnbd-srv: use bio_add_virt_nofai... Johannes Thumshirn
- [PATCH 11/17] xfs: simplify xfs_buf_submit_bio Christoph Hellwig
- Re: [PATCH 11/17] xfs: simplify xfs_buf_submit_bio Damien Le Moal
- Re: [PATCH 11/17] xfs: simplify xfs_buf_submit_bio Darrick J. Wong
- [PATCH 14/17] hfsplus: use bdev_rw_virt in hfsplus_subm... Christoph Hellwig
- Re: [PATCH 14/17] hfsplus: use bdev_rw_virt in hfs... Damien Le Moal
- Re: [PATCH 14/17] hfsplus: use bdev_rw_virt in hfs... Johannes Thumshirn
- [PATCH 12/17] xfs: simplify xfs_rw_bdev Christoph Hellwig
- Re: [PATCH 12/17] xfs: simplify xfs_rw_bdev Damien Le Moal
- Re: [PATCH 12/17] xfs: simplify xfs_rw_bdev Darrick J. Wong