drbd: Fixed handling of read errors on a 'VerifyT' node

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
This commit is contained in:
Philipp Reisner 2011-03-01 15:52:35 +01:00
parent 7fde2be930
commit 8f21420ebd

View file

@ -1081,25 +1081,27 @@ int w_e_end_ov_req(struct drbd_conf *mdev, struct drbd_work *w, int cancel)
if (unlikely(cancel)) if (unlikely(cancel))
goto out; goto out;
if (unlikely((e->flags & EE_WAS_ERROR) != 0))
goto out;
digest_size = crypto_hash_digestsize(mdev->verify_tfm); digest_size = crypto_hash_digestsize(mdev->verify_tfm);
/* FIXME if this allocation fails, online verify will not terminate! */
digest = kmalloc(digest_size, GFP_NOIO); digest = kmalloc(digest_size, GFP_NOIO);
if (digest) { if (!digest) {
ok = 0; /* terminate the connection in case the allocation failed */
goto out;
}
if (likely(!(e->flags & EE_WAS_ERROR)))
drbd_csum_ee(mdev, mdev->verify_tfm, e, digest); drbd_csum_ee(mdev, mdev->verify_tfm, e, digest);
else
memset(digest, 0, digest_size);
inc_rs_pending(mdev); inc_rs_pending(mdev);
ok = drbd_send_drequest_csum(mdev, e->sector, e->size, ok = drbd_send_drequest_csum(mdev, e->sector, e->size,
digest, digest_size, P_OV_REPLY); digest, digest_size, P_OV_REPLY);
if (!ok) if (!ok)
dec_rs_pending(mdev); dec_rs_pending(mdev);
kfree(digest); kfree(digest);
}
out: out:
drbd_free_ee(mdev, e); drbd_free_ee(mdev, e);
dec_unacked(mdev); dec_unacked(mdev);
return ok; return ok;