public inbox for lvm2-cvs@sourceware.org help / color / mirror / Atom feed
From: zkabelac@sourceware.org To: lvm-devel@redhat.com, lvm2-cvs@sourceware.org Subject: LVM2 ./WHATS_NEW lib/mirror/mirrored.c Date: Thu, 23 Feb 2012 22:30:00 -0000 [thread overview] Message-ID: <20120223223022.9889.qmail@sourceware.org> (raw) CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: zkabelac@sourceware.org 2012-02-23 22:30:20 Modified files: . : WHATS_NEW lib/mirror : mirrored.c Log message: Use same signed numbers Keep unsigned aritmetic. TODO: we should probably switch dm_split_words() to return unsigned numbers. (minor API libdm change mostly compatible) Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2306&r2=1.2307 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/mirror/mirrored.c.diff?cvsroot=lvm2&r1=1.95&r2=1.96 --- LVM2/WHATS_NEW 2012/02/23 18:26:28 1.2306 +++ LVM2/WHATS_NEW 2012/02/23 22:30:20 1.2307 @@ -1,5 +1,6 @@ Version 2.02.94 - ==================================== + Use same signed numbers in _mirrored_transient_status(). Integrate client-side lvmetad into build. Version 2.02.93 - 23rd February 2012 --- LVM2/lib/mirror/mirrored.c 2012/02/23 22:24:47 1.95 +++ LVM2/lib/mirror/mirrored.c 2012/02/23 22:30:20 1.96 @@ -226,14 +226,14 @@ static int _mirrored_transient_status(struct lv_segment *seg, char *params) { - int i, j; + unsigned i, j; struct logical_volume *lv = seg->lv; struct lvinfo info; char *p = NULL; char **args, **log_args; struct logical_volume **images; struct logical_volume *log; - int num_devs, log_argc; + unsigned num_devs, log_argc; int failed = 0; char *status; @@ -243,12 +243,12 @@ if (!dm_split_words(params, 1, 0, &p)) return_0; - if (!(num_devs = atoi(p))) + if (!(num_devs = (unsigned) atoi(p))) return_0; p += strlen(p) + 1; - if (num_devs > DEFAULT_MIRROR_MAX_IMAGES || num_devs < 0) { + if (num_devs > DEFAULT_MIRROR_MAX_IMAGES) { log_error("Unexpectedly many (%d) mirror images in %s.", num_devs, lv->name); return 0; @@ -257,12 +257,13 @@ args = alloca((num_devs + 5) * sizeof(char *)); images = alloca(num_devs * sizeof(struct logical_volume *)); - if (dm_split_words(p, num_devs + 4, 0, args) < num_devs + 4) + /* FIXME: dm_split_words() should return unsigned */ + if ((unsigned)dm_split_words(p, num_devs + 4, 0, args) < num_devs + 4) return_0; - log_argc = atoi(args[3 + num_devs]); + log_argc = (unsigned) atoi(args[3 + num_devs]); - if (log_argc > 16 || log_argc < 0) { + if (log_argc > 16) { log_error("Unexpectedly many (%d) log arguments in %s.", log_argc, lv->name); return 0; @@ -270,8 +271,8 @@ log_args = alloca(log_argc * sizeof(char *)); - if (dm_split_words(args[3 + num_devs] + strlen(args[3 + num_devs]) + 1, - log_argc, 0, log_args) < log_argc) + if ((unsigned)dm_split_words(args[3 + num_devs] + strlen(args[3 + num_devs]) + 1, + log_argc, 0, log_args) < log_argc) return_0; if (num_devs != seg->area_count) {
next reply other threads:[~2012-02-23 22:30 UTC|newest] Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top 2012-02-23 22:30 zkabelac [this message] -- strict thread matches above, loose matches on Subject: below -- 2012-02-13 11:07 zkabelac 2011-06-17 14:17 zkabelac 2010-12-01 13:01 zkabelac 2010-05-24 16:30 agk 2009-11-18 16:48 mbroz 2008-07-31 14:43 agk 2008-01-16 15:24 agk 2006-05-11 19:47 agk 2005-10-26 16:12 agk 2005-09-02 16:59 agk
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=20120223223022.9889.qmail@sourceware.org \ --to=zkabelac@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: linkBe 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).