diff options
author | Lars Ellenberg <lars.ellenberg@linbit.com> | 2011-01-24 08:47:09 -0500 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2011-03-10 05:48:10 -0500 |
commit | 10f6d9926cd17afff9dc03c967706419798b4929 (patch) | |
tree | 7b1cd4bfcffbb3832c756ce29861411f7300aadd /drivers/block/drbd/drbd_worker.c | |
parent | 039312b6481e2928f3be19fee94c83327d93e4c7 (diff) |
drbd: don't BUG_ON, if bio_add_page of a single page to an empty bio fails
Just deal with it more gracefully, if we fail to add even a single page
to an empty bio. We used to BUG_ON() there, but it has been observed in
some Xen deployment, so we need to handle that case more robustly now.
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block/drbd/drbd_worker.c')
-rw-r--r-- | drivers/block/drbd/drbd_worker.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/block/drbd/drbd_worker.c b/drivers/block/drbd/drbd_worker.c index ff0eb308ee4a..cfd324b9f95b 100644 --- a/drivers/block/drbd/drbd_worker.c +++ b/drivers/block/drbd/drbd_worker.c | |||
@@ -369,9 +369,10 @@ static int read_for_csum(struct drbd_conf *mdev, sector_t sector, int size) | |||
369 | if (drbd_submit_ee(mdev, e, READ, DRBD_FAULT_RS_RD) == 0) | 369 | if (drbd_submit_ee(mdev, e, READ, DRBD_FAULT_RS_RD) == 0) |
370 | return 0; | 370 | return 0; |
371 | 371 | ||
372 | /* drbd_submit_ee currently fails for one reason only: | 372 | /* If it failed because of ENOMEM, retry should help. If it failed |
373 | * not being able to allocate enough bios. | 373 | * because bio_add_page failed (probably broken lower level driver), |
374 | * Is dropping the connection going to help? */ | 374 | * retry may or may not help. |
375 | * If it does not, you may need to force disconnect. */ | ||
375 | spin_lock_irq(&mdev->req_lock); | 376 | spin_lock_irq(&mdev->req_lock); |
376 | list_del(&e->w.list); | 377 | list_del(&e->w.list); |
377 | spin_unlock_irq(&mdev->req_lock); | 378 | spin_unlock_irq(&mdev->req_lock); |