aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ellenberg <lars.ellenberg@linbit.com>2010-11-11 04:47:05 -0500
committerPhilipp Reisner <philipp.reisner@linbit.com>2011-03-10 05:19:09 -0500
commit3129b1b9aed15bbebde1b2a5719434273feb295d (patch)
tree1a9242e43ae853c6af2c20278d814d0138eb9f37
parent470be44ab1841f3261a4d758450a42e6b79e9551 (diff)
drbd: debug: limit nelink-broadcast of request on digest mismatch to 32k
We used to be limited to 32k requests, but have increased that limit to 128k now. This part of the code can only deal with 32k, it would scramble arbitrary pages for larger requests. As it is used for debugging only anyways, it is ok to simply truncate the dumped data here. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
-rw-r--r--drivers/block/drbd/drbd_nl.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c
index 8cbfaa687d72..dad559810ed6 100644
--- a/drivers/block/drbd/drbd_nl.c
+++ b/drivers/block/drbd/drbd_nl.c
@@ -2398,10 +2398,11 @@ void drbd_bcast_ee(struct drbd_conf *mdev,
2398 tl = tl_add_int(tl, T_ee_sector, &e->sector); 2398 tl = tl_add_int(tl, T_ee_sector, &e->sector);
2399 tl = tl_add_int(tl, T_ee_block_id, &e->block_id); 2399 tl = tl_add_int(tl, T_ee_block_id, &e->block_id);
2400 2400
2401 /* dump the first 32k */
2402 len = min_t(unsigned, e->size, 32 << 10);
2401 put_unaligned(T_ee_data, tl++); 2403 put_unaligned(T_ee_data, tl++);
2402 put_unaligned(e->size, tl++); 2404 put_unaligned(len, tl++);
2403 2405
2404 len = e->size;
2405 page = e->pages; 2406 page = e->pages;
2406 page_chain_for_each(page) { 2407 page_chain_for_each(page) {
2407 void *d = kmap_atomic(page, KM_USER0); 2408 void *d = kmap_atomic(page, KM_USER0);
@@ -2410,6 +2411,8 @@ void drbd_bcast_ee(struct drbd_conf *mdev,
2410 kunmap_atomic(d, KM_USER0); 2411 kunmap_atomic(d, KM_USER0);
2411 tl = (unsigned short*)((char*)tl + l); 2412 tl = (unsigned short*)((char*)tl + l);
2412 len -= l; 2413 len -= l;
2414 if (len == 0)
2415 break;
2413 } 2416 }
2414 put_unaligned(TT_END, tl++); /* Close the tag list */ 2417 put_unaligned(TT_END, tl++); /* Close the tag list */
2415 2418