<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">From: Jonathan Brassow &lt;jbrassow@redhat.com&gt;

The internally generated constructor argument (device size) is
necessary for creating userspace logs.  However, it is difficult
to strip out from our stored string when we wish to print
back what the original string we were given.

The fix is simply to re-order the arguments in the string -
putting the internally generated argument first instead of
last.  (This makes it easy to skip over it later.)

Signed-off-by: Jonathan Brassow &lt;jbrassow@redhat.com&gt;
Signed-off-by: Alasdair G Kergon &lt;agk@redhat.com&gt;

---
 drivers/md/dm-log-userspace-base.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Index: linux-2.6.31-rc8/drivers/md/dm-log-userspace-base.c
===================================================================
--- linux-2.6.31-rc8.orig/drivers/md/dm-log-userspace-base.c
+++ linux-2.6.31-rc8/drivers/md/dm-log-userspace-base.c
@@ -111,10 +111,9 @@ static int build_constructor_string(stru
 		return -ENOMEM;
 	}
 
-	for (i = 0, str_size = 0; i &lt; argc; i++)
-		str_size += sprintf(str + str_size, "%s ", argv[i]);
-	str_size += sprintf(str + str_size, "%llu",
-			    (unsigned long long)ti-&gt;len);
+	str_size = sprintf(str, "%llu", (unsigned long long)ti-&gt;len);
+	for (i = 0; i &lt; argc; i++)
+		str_size += sprintf(str + str_size, " %s", argv[i]);
 
 	*ctr_str = str;
 	return str_size;
</pre></body></html>