Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

block: drbd: remove impossible failure handling

For a non-cloned bio, bio_add_page() only returns failure when
the io vec table is full, but in that case, bio->bi_vcnt can't
be zero at all.

So remove the impossible failure handling.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Jens Axboe <axboe@fb.com>

authored by

Ming Lei and committed by
Jens Axboe
06efffda 3a83f467

+1 -13
+1 -13
drivers/block/drbd/drbd_receiver.c
··· 1648 1648 1649 1649 page_chain_for_each(page) { 1650 1650 unsigned len = min_t(unsigned, data_size, PAGE_SIZE); 1651 - if (!bio_add_page(bio, page, len, 0)) { 1652 - /* A single page must always be possible! 1653 - * But in case it fails anyways, 1654 - * we deal with it, and complain (below). */ 1655 - if (bio->bi_vcnt == 0) { 1656 - drbd_err(device, 1657 - "bio_add_page failed for len=%u, " 1658 - "bi_vcnt=0 (bi_sector=%llu)\n", 1659 - len, (uint64_t)bio->bi_iter.bi_sector); 1660 - err = -ENOSPC; 1661 - goto fail; 1662 - } 1651 + if (!bio_add_page(bio, page, len, 0)) 1663 1652 goto next_bio; 1664 - } 1665 1653 data_size -= len; 1666 1654 sector += len >> 9; 1667 1655 --nr_pages;