Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1511594 > unrolled thread
| Started by | Ming Lei <tom.leiming@gmail.com> |
|---|---|
| First post | 2016-10-29 10:40 +0200 |
| Last post | 2016-10-31 16:30 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH 03/60] block: drbd: remove impossible failure handling Ming Lei <tom.leiming@gmail.com> - 2016-10-29 10:40 +0200
Re: [PATCH 03/60] block: drbd: remove impossible failure handling Christoph Hellwig <hch@infradead.org> - 2016-10-31 16:30 +0100
| From | Ming Lei <tom.leiming@gmail.com> |
|---|---|
| Date | 2016-10-29 10:40 +0200 |
| Subject | [PATCH 03/60] block: drbd: remove impossible failure handling |
| Message-ID | <sxxlf-3Nw-7@gated-at.bofh.it> |
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.
Acked-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
---
drivers/block/drbd/drbd_receiver.c | 14 +-------------
1 file changed, 1 insertion(+), 13 deletions(-)
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c
index 942384f34e22..c537e3bd09eb 100644
--- a/drivers/block/drbd/drbd_receiver.c
+++ b/drivers/block/drbd/drbd_receiver.c
@@ -1648,20 +1648,8 @@ int drbd_submit_peer_request(struct drbd_device *device,
page_chain_for_each(page) {
unsigned len = min_t(unsigned, data_size, PAGE_SIZE);
- if (!bio_add_page(bio, page, len, 0)) {
- /* A single page must always be possible!
- * But in case it fails anyways,
- * we deal with it, and complain (below). */
- if (bio->bi_vcnt == 0) {
- drbd_err(device,
- "bio_add_page failed for len=%u, "
- "bi_vcnt=0 (bi_sector=%llu)\n",
- len, (uint64_t)bio->bi_iter.bi_sector);
- err = -ENOSPC;
- goto fail;
- }
+ if (!bio_add_page(bio, page, len, 0))
goto next_bio;
- }
data_size -= len;
sector += len >> 9;
--nr_pages;
--
2.7.4
[toc] | [next] | [standalone]
| From | Christoph Hellwig <hch@infradead.org> |
|---|---|
| Date | 2016-10-31 16:30 +0100 |
| Message-ID | <symH8-4bf-31@gated-at.bofh.it> |
| In reply to | #1511594 |
On Sat, Oct 29, 2016 at 04:08:02PM +0800, Ming Lei wrote: > 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. > > Acked-by: Lars Ellenberg <lars.ellenberg@linbit.com> > Signed-off-by: Ming Lei <tom.leiming@gmail.com> Looks good, Reviewed-by: Christoph Hellwig <hch@lst.de>
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web