aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/drbd/drbd_receiver.c
diff options
context:
space:
mode:
authorLars Ellenberg <lars.ellenberg@linbit.com>2010-04-01 10:57:19 -0400
committerPhilipp Reisner <philipp.reisner@linbit.com>2010-05-17 19:07:38 -0400
commitc3470cde57ea34d9b4bd34891ec040e46b9fb3bf (patch)
treeb1aa11a591b7cd1cbaf3fa9abb21ec7c8050267a /drivers/block/drbd/drbd_receiver.c
parent8d1894ebe441093cfd967affcbc56b764960575e (diff)
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/block/drbd/drbd_receiver.c')
-rw-r--r--drivers/block/drbd/drbd_receiver.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c
index 93106fb92be8..c7285e16b667 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)
1331 int rr, rv = 1; 1331 int rr, rv = 1;
1332 void *data; 1332 void *data;
1333 1333
1334 if (!data_size)
1335 return TRUE;
1336
1334 page = drbd_pp_alloc(mdev, 1); 1337 page = drbd_pp_alloc(mdev, 1);
1335 1338
1336 data = kmap(page); 1339 data = kmap(page);
@@ -1946,7 +1949,7 @@ static int receive_DataRequest(struct drbd_conf *mdev, struct p_header *h)
1946 "no local data.\n"); 1949 "no local data.\n");
1947 drbd_send_ack_rp(mdev, h->command == P_DATA_REQUEST ? P_NEG_DREPLY : 1950 drbd_send_ack_rp(mdev, h->command == P_DATA_REQUEST ? P_NEG_DREPLY :
1948 P_NEG_RS_DREPLY , p); 1951 P_NEG_RS_DREPLY , p);
1949 return TRUE; 1952 return drbd_drain_block(mdev, h->length - brps);
1950 } 1953 }
1951 1954
1952 /* GFP_NOIO, because we must not cause arbitrary write-out: in a DRBD 1955 /* GFP_NOIO, because we must not cause arbitrary write-out: in a DRBD