diff options
author | Philipp Reisner <philipp.reisner@linbit.com> | 2011-03-01 09:52:35 -0500 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2011-03-10 05:48:18 -0500 |
commit | 8f21420ebd5ca5a751e2f606b49b0acd2a2af314 (patch) | |
tree | bf652362959fa629c17b1954b861783d894eb131 /drivers/block | |
parent | 7fde2be93080c028c20078a2d6abec8a95891192 (diff) |
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>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/drbd/drbd_worker.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/drivers/block/drbd/drbd_worker.c b/drivers/block/drbd/drbd_worker.c index 3d70d8d015d9..7db29080f363 100644 --- a/drivers/block/drbd/drbd_worker.c +++ b/drivers/block/drbd/drbd_worker.c | |||
@@ -1081,25 +1081,27 @@ int w_e_end_ov_req(struct drbd_conf *mdev, struct drbd_work *w, int cancel) | |||
1081 | if (unlikely(cancel)) | 1081 | if (unlikely(cancel)) |
1082 | goto out; | 1082 | goto out; |
1083 | 1083 | ||
1084 | if (unlikely((e->flags & EE_WAS_ERROR) != 0)) | ||
1085 | goto out; | ||
1086 | |||
1087 | digest_size = crypto_hash_digestsize(mdev->verify_tfm); | 1084 | digest_size = crypto_hash_digestsize(mdev->verify_tfm); |
1088 | /* FIXME if this allocation fails, online verify will not terminate! */ | ||
1089 | digest = kmalloc(digest_size, GFP_NOIO); | 1085 | digest = kmalloc(digest_size, GFP_NOIO); |
1090 | if (digest) { | 1086 | if (!digest) { |
1091 | drbd_csum_ee(mdev, mdev->verify_tfm, e, digest); | 1087 | ok = 0; /* terminate the connection in case the allocation failed */ |
1092 | inc_rs_pending(mdev); | 1088 | goto out; |
1093 | ok = drbd_send_drequest_csum(mdev, e->sector, e->size, | ||
1094 | digest, digest_size, P_OV_REPLY); | ||
1095 | if (!ok) | ||
1096 | dec_rs_pending(mdev); | ||
1097 | kfree(digest); | ||
1098 | } | 1089 | } |
1099 | 1090 | ||
1091 | if (likely(!(e->flags & EE_WAS_ERROR))) | ||
1092 | drbd_csum_ee(mdev, mdev->verify_tfm, e, digest); | ||
1093 | else | ||
1094 | memset(digest, 0, digest_size); | ||
1095 | |||
1096 | inc_rs_pending(mdev); | ||
1097 | ok = drbd_send_drequest_csum(mdev, e->sector, e->size, | ||
1098 | digest, digest_size, P_OV_REPLY); | ||
1099 | if (!ok) | ||
1100 | dec_rs_pending(mdev); | ||
1101 | kfree(digest); | ||
1102 | |||
1100 | out: | 1103 | out: |
1101 | drbd_free_ee(mdev, e); | 1104 | drbd_free_ee(mdev, e); |
1102 | |||
1103 | dec_unacked(mdev); | 1105 | dec_unacked(mdev); |
1104 | 1106 | ||
1105 | return ok; | 1107 | return ok; |