diff options
author | Lars Ellenberg <lars.ellenberg@linbit.com> | 2010-04-01 16:57:19 +0200 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2010-05-18 01:07:38 +0200 |
commit | c3470cde57ea34d9b4bd34891ec040e46b9fb3bf (patch) | |
tree | b1aa11a591b7cd1cbaf3fa9abb21ec7c8050267a /drivers | |
parent | 8d1894ebe441093cfd967affcbc56b764960575e (diff) | |
download | kernel_samsung_aries-c3470cde57ea34d9b4bd34891ec040e46b9fb3bf.zip kernel_samsung_aries-c3470cde57ea34d9b4bd34891ec040e46b9fb3bf.tar.gz kernel_samsung_aries-c3470cde57ea34d9b4bd34891ec040e46b9fb3bf.tar.bz2 |
drbd: fix potential protocol error
Don't forget to drain the digest in case we cannot satisfy a
checksum based resync or online-verify request.
It would additionally cause a protocoll error,
dropping the connection.
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/block/drbd/drbd_receiver.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index 93106fb..c7285e1 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c @@ -1331,6 +1331,9 @@ static int drbd_drain_block(struct drbd_conf *mdev, int data_size) int rr, rv = 1; void *data; + if (!data_size) + return TRUE; + page = drbd_pp_alloc(mdev, 1); data = kmap(page); @@ -1946,7 +1949,7 @@ static int receive_DataRequest(struct drbd_conf *mdev, struct p_header *h) "no local data.\n"); drbd_send_ack_rp(mdev, h->command == P_DATA_REQUEST ? P_NEG_DREPLY : P_NEG_RS_DREPLY , p); - return TRUE; + return drbd_drain_block(mdev, h->length - brps); } /* GFP_NOIO, because we must not cause arbitrary write-out: in a DRBD |