aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm-log-userspace-base.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/md/dm-log-userspace-base.c b/drivers/md/dm-log-userspace-base.c
index 2f2a244e1109..c49da0a41c8e 100644
--- a/drivers/md/dm-log-userspace-base.c
+++ b/drivers/md/dm-log-userspace-base.c
@@ -111,10 +111,9 @@ static int build_constructor_string(struct dm_target *ti,
111 return -ENOMEM; 111 return -ENOMEM;
112 } 112 }
113 113
114 for (i = 0, str_size = 0; i < argc; i++) 114 str_size = sprintf(str, "%llu", (unsigned long long)ti->len);
115 str_size += sprintf(str + str_size, "%s ", argv[i]); 115 for (i = 0; i < argc; i++)
116 str_size += sprintf(str + str_size, "%llu", 116 str_size += sprintf(str + str_size, " %s", argv[i]);
117 (unsigned long long)ti->len);
118 117
119 *ctr_str = str; 118 *ctr_str = str;
120 return str_size; 119 return str_size;
@@ -561,6 +560,7 @@ static int userspace_status(struct dm_dirty_log *log, status_type_t status_type,
561 char *result, unsigned maxlen) 560 char *result, unsigned maxlen)
562{ 561{
563 int r = 0; 562 int r = 0;
563 char *table_args;
564 size_t sz = (size_t)maxlen; 564 size_t sz = (size_t)maxlen;
565 struct log_c *lc = log->context; 565 struct log_c *lc = log->context;
566 566
@@ -577,8 +577,12 @@ static int userspace_status(struct dm_dirty_log *log, status_type_t status_type,
577 break; 577 break;
578 case STATUSTYPE_TABLE: 578 case STATUSTYPE_TABLE:
579 sz = 0; 579 sz = 0;
580 DMEMIT("%s %u %s %s ", log->type->name, lc->usr_argc + 1, 580 table_args = strstr(lc->usr_argv_str, " ");
581 lc->uuid, lc->usr_argv_str); 581 BUG_ON(!table_args); /* There will always be a ' ' */
582 table_args++;
583
584 DMEMIT("%s %u %s %s ", log->type->name, lc->usr_argc,
585 lc->uuid, table_args);
582 break; 586 break;
583 } 587 }
584 return (r) ? 0 : (int)sz; 588 return (r) ? 0 : (int)sz;