Skip to content

Commit

Permalink
drbd: debug: limit nelink-broadcast of request on digest mismatch to 32k
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Lars Ellenberg authored and Philipp Reisner committed Mar 10, 2011
1 parent 470be44 commit 3129b1b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/block/drbd/drbd_nl.c
Original file line number Diff line number Diff line change
Expand Up @@ -2398,10 +2398,11 @@ void drbd_bcast_ee(struct drbd_conf *mdev,
tl = tl_add_int(tl, T_ee_sector, &e->sector);
tl = tl_add_int(tl, T_ee_block_id, &e->block_id);

/* dump the first 32k */
len = min_t(unsigned, e->size, 32 << 10);
put_unaligned(T_ee_data, tl++);
put_unaligned(e->size, tl++);
put_unaligned(len, tl++);

len = e->size;
page = e->pages;
page_chain_for_each(page) {
void *d = kmap_atomic(page, KM_USER0);
Expand All @@ -2410,6 +2411,8 @@ void drbd_bcast_ee(struct drbd_conf *mdev,
kunmap_atomic(d, KM_USER0);
tl = (unsigned short*)((char*)tl + l);
len -= l;
if (len == 0)
break;
}
put_unaligned(TT_END, tl++); /* Close the tag list */

Expand Down

0 comments on commit 3129b1b

Please sign in to comment.