public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
From: jbrassow@sourceware.org
To: lvm-devel@redhat.com, lvm2-cvs@sourceware.org
Subject: LVM2/daemons/clogd functions.c
Date: Fri, 28 Aug 2009 05:27:00 -0000	[thread overview]
Message-ID: <20090828052709.12553.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	jbrassow@sourceware.org	2009-08-28 05:27:09

Modified files:
	daemons/clogd  : functions.c 

Log message:
	cluster log daemon (clogd): Adjust for kernel CTR arg reordering
	
	We have moved the internally generated mirror-device-size
	parameter from the end of the CTR string to the begining.
	This change adjusts for that.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clogd/functions.c.diff?cvsroot=lvm2&r1=1.8&r2=1.9

--- LVM2/daemons/clogd/functions.c	2009/08/13 16:34:07	1.8
+++ LVM2/daemons/clogd/functions.c	2009/08/28 05:27:09	1.9
@@ -540,6 +540,7 @@
 {
 	int argc, i, r = 0;
 	char *p, **argv = NULL;
+	char *dev_size_str;
 	uint64_t device_size;
 
 	/* Sanity checks */
@@ -559,14 +560,16 @@
 	}
 
 	/* Split up args */
-	for (argc = 1, p = rq->data; (p = strstr(p, " ")); p++, argc++)
+	for (argc = 0, p = rq->data; (p = strstr(p, " ")); p++, argc++)
 		*p = '\0';
 
 	argv = malloc(argc * sizeof(char *));
 	if (!argv)
 		return -ENOMEM;
 
-	for (i = 0, p = rq->data; i < argc; i++, p = p + strlen(p) + 1)
+	p = dev_size_str = rq->data;
+	p += strlen(p) + 1;
+	for (i = 0; i < argc; i++, p = p + strlen(p) + 1)
 		argv[i] = p;
 
 	if (strcmp(argv[0], "clustered_disk") &&
@@ -576,13 +579,12 @@
 		return -EINVAL;
 	}
 
-	if (!(device_size = strtoll(argv[argc - 1], &p, 0)) || *p) {
-		LOG_ERROR("Invalid device size argument: %s", argv[argc - 1]);
+	if (!(device_size = strtoll(dev_size_str, &p, 0)) || *p) {
+		LOG_ERROR("Invalid device size argument: %s", dev_size_str);
 		free(argv);
 		return -EINVAL;
 	}
 
-	argc--;  /* We pass in the device_size separate */
 	r = _clog_ctr(rq->uuid, rq->luid, argc - 1, argv + 1, device_size);
 
 	/* We join the CPG when we resume */


                 reply	other threads:[~2009-08-28  5:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090828052709.12553.qmail@sourceware.org \
    --to=jbrassow@sourceware.org \
    --cc=lvm-devel@redhat.com \
    --cc=lvm2-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).