Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 180580
b: refs/heads/master
c: ebfd32b
h: refs/heads/master
v: v3
  • Loading branch information
Jonathan Brassow authored and Alasdair G Kergon committed Feb 16, 2010
1 parent 441f88b commit cf4959d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 55f67f2dedec1e3049abc30b6d82b999a14cafb7
refs/heads/master: ebfd32bba9b518d684009d9d21a56742337ca1b3
10 changes: 7 additions & 3 deletions trunk/drivers/md/dm-log-userspace-transfer.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,15 @@ int dm_consult_userspace(const char *uuid, uint64_t luid, int request_type,
{
int r = 0;
size_t dummy = 0;
int overhead_size =
sizeof(struct dm_ulog_request *) + sizeof(struct cn_msg);
int overhead_size = sizeof(struct dm_ulog_request) + sizeof(struct cn_msg);
struct dm_ulog_request *tfr = prealloced_ulog_tfr;
struct receiving_pkg pkg;

/*
* Given the space needed to hold the 'struct cn_msg' and
* 'struct dm_ulog_request' - do we have enough payload
* space remaining?
*/
if (data_size > (DM_ULOG_PREALLOCED_SIZE - overhead_size)) {
DMINFO("Size of tfr exceeds preallocated size");
return -EINVAL;
Expand All @@ -191,7 +195,7 @@ int dm_consult_userspace(const char *uuid, uint64_t luid, int request_type,
*/
mutex_lock(&dm_ulog_lock);

memset(tfr, 0, DM_ULOG_PREALLOCED_SIZE - overhead_size);
memset(tfr, 0, DM_ULOG_PREALLOCED_SIZE - sizeof(struct cn_msg));
memcpy(tfr->uuid, uuid, DM_UUID_LEN);
tfr->luid = luid;
tfr->seq = dm_ulog_seq++;
Expand Down

0 comments on commit cf4959d

Please sign in to comment.