All of lore.kernel.org
 help / color / mirror / Atom feed
From: zkabelac@sourceware.org <zkabelac@sourceware.org>
To: lvm-devel@redhat.com
Subject: LVM2 ./WHATS_NEW_DM libdm/ioctl/libdm-iface.c
Date: 8 Feb 2012 11:25:11 -0000	[thread overview]
Message-ID: <20120208112511.3067.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac at sourceware.org	2012-02-08 11:25:10

Modified files:
	.              : WHATS_NEW_DM 
	libdm/ioctl    : libdm-iface.c 

Log message:
	Set all parameters to 0
	
	Since the function dm_get_next_target() returns NULL as 'next' pointer
	so it's not a 'real' error - set 0 to all parameters when NULL is
	returned because of missing head.
	
	i.e. one of use case::
	do {
	next = dm_get_next_target(dmt, next, &start, &length,
	&target_type, &params);
	size += length;
	} while (next);

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW_DM.diff?cvsroot=lvm2&r1=1.540&r2=1.541
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/ioctl/libdm-iface.c.diff?cvsroot=lvm2&r1=1.132&r2=1.133

--- LVM2/WHATS_NEW_DM	2012/02/08 11:07:17	1.540
+++ LVM2/WHATS_NEW_DM	2012/02/08 11:25:09	1.541
@@ -1,5 +1,6 @@
 Version 1.02.70 - 
 ===================================
+  Set all parameters to 0 for dm_get_next_target() for NULL return.
   Fix fd resource leak in error path for _udev_notify_sem_create().
   Leave space for '\0' for readline() call in _sysfs_get_kernel_name().
 
--- LVM2/libdm/ioctl/libdm-iface.c	2012/01/17 14:36:59	1.132
+++ LVM2/libdm/ioctl/libdm-iface.c	2012/02/08 11:25:10	1.133
@@ -573,8 +573,13 @@
 	if (!t)
 		t = dmt->head;
 
-	if (!t)
+	if (!t) {
+		*start = 0;
+		*length = 0;
+		*target_type = 0;
+		*params = 0;
 		return NULL;
+	}
 
 	*start = t->start;
 	*length = t->length;



             reply	other threads:[~2012-02-08 11:25 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-08 11:25 zkabelac [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-03-01 10:07 LVM2 ./WHATS_NEW_DM libdm/ioctl/libdm-iface.c zkabelac
2012-02-15 12:17 prajnoha
2012-02-08 12:59 zkabelac
2011-11-08 17:32 snitzer
2011-10-20 10:38 zkabelac
2011-09-13 15:13 prajnoha
2011-09-16 12:07 ` Alasdair G Kergon
2011-09-17 19:34   ` Mikulas Patocka
2011-08-11 20:49 zkabelac
2011-07-24 23:59 agk
2011-07-02  1:17 agk
2011-06-09 15:07 mbroz
2011-03-25 23:50 agk
2011-03-08 22:43 zkabelac
2011-03-01 23:27 agk
2011-02-21 16:26 snitzer
2010-08-18 13:11 prajnoha
2010-05-13 13:31 mbroz

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=20120208112511.3067.qmail@sourceware.org \
    --to=zkabelac@sourceware.org \
    --cc=lvm-devel@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.