Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 157220
b: refs/heads/master
c: b8313b6
h: refs/heads/master
v: v3
  • Loading branch information
Jonathan Brassow authored and Alasdair G Kergon committed Sep 4, 2009
1 parent eaa2915 commit 2cb7fe5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 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: 4142a969175302bc843d1505133488bfdbfa4732
refs/heads/master: b8313b6da7e2e7c7f47d93d8561969a3ff9ba0ea
16 changes: 10 additions & 6 deletions trunk/drivers/md/dm-log-userspace-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,9 @@ static int build_constructor_string(struct dm_target *ti,
return -ENOMEM;
}

for (i = 0, str_size = 0; i < argc; i++)
str_size += sprintf(str + str_size, "%s ", argv[i]);
str_size += sprintf(str + str_size, "%llu",
(unsigned long long)ti->len);
str_size = sprintf(str, "%llu", (unsigned long long)ti->len);
for (i = 0; i < argc; i++)
str_size += sprintf(str + str_size, " %s", argv[i]);

*ctr_str = str;
return str_size;
Expand Down Expand Up @@ -561,6 +560,7 @@ static int userspace_status(struct dm_dirty_log *log, status_type_t status_type,
char *result, unsigned maxlen)
{
int r = 0;
char *table_args;
size_t sz = (size_t)maxlen;
struct log_c *lc = log->context;

Expand All @@ -577,8 +577,12 @@ static int userspace_status(struct dm_dirty_log *log, status_type_t status_type,
break;
case STATUSTYPE_TABLE:
sz = 0;
DMEMIT("%s %u %s %s ", log->type->name, lc->usr_argc + 1,
lc->uuid, lc->usr_argv_str);
table_args = strstr(lc->usr_argv_str, " ");
BUG_ON(!table_args); /* There will always be a ' ' */
table_args++;

DMEMIT("%s %u %s %s ", log->type->name, lc->usr_argc,
lc->uuid, table_args);
break;
}
return (r) ? 0 : (int)sz;
Expand Down

0 comments on commit 2cb7fe5

Please sign in to comment.