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/filters/filter-persistent ...
Date: Tue, 28 Feb 2012 11:13:00 -0000	[thread overview]
Message-ID: <20120228111300.4118.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2012-02-28 11:12:59

Modified files:
	.              : WHATS_NEW 
	lib/filters    : filter-persistent.c 
	lib/metadata   : metadata.c 

Log message:
	Test dm_hash_insert() failures mem failures

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2323&r2=1.2324
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/filters/filter-persistent.c.diff?cvsroot=lvm2&r1=1.52&r2=1.53
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.490&r2=1.491

--- LVM2/WHATS_NEW	2012/02/28 11:06:56	1.2323
+++ LVM2/WHATS_NEW	2012/02/28 11:12:58	1.2324
@@ -1,5 +1,6 @@
 Version 2.02.94 - 
 ====================================
+  Test dm_hash_insert() failures in filter-persistent.c and fid_add_mda().
   Ensure clvmd message is always \0 terminated after read.
   Better detection of missing dmeventd fifo connection (2.02.93).
   Add some close() and dev_close() error path backtraces.
--- LVM2/lib/filters/filter-persistent.c	2011/12/18 21:56:04	1.52
+++ LVM2/lib/filters/filter-persistent.c	2012/02/28 11:12:58	1.53
@@ -292,7 +292,10 @@
 	if (MAJOR(dev->dev) == dm_major()) {
 		if (!l)
 			dm_list_iterate_items(sl, &dev->aliases)
-				dm_hash_insert(pf->devices, sl->str, PF_GOOD_DEVICE);
+				if (!dm_hash_insert(pf->devices, sl->str, PF_GOOD_DEVICE)) {
+					log_error("Failed to hash device to filter.");
+					return 0;
+				}
 		if (!device_is_usable(dev)) {
 			log_debug("%s: Skipping unusable device", dev_name(dev));
 			return 0;
@@ -305,7 +308,10 @@
 		l = pf->real->passes_filter(pf->real, dev) ?  PF_GOOD_DEVICE : PF_BAD_DEVICE;
 
 		dm_list_iterate_items(sl, &dev->aliases)
-			dm_hash_insert(pf->devices, sl->str, l);
+			if (!dm_hash_insert(pf->devices, sl->str, l)) {
+				log_error("Failed to hash alias to filter.");
+				return 0;
+			}
 	}
 
 	return (l == PF_BAD_DEVICE) ? 0 : 1;
--- LVM2/lib/metadata/metadata.c	2012/02/28 11:10:45	1.490
+++ LVM2/lib/metadata/metadata.c	2012/02/28 11:12:58	1.491
@@ -4283,8 +4283,11 @@
 				    full_key, sizeof(full_key)))
 		return_0;
 
-	dm_hash_insert(fid->metadata_areas_index,
-		       full_key, mda);
+	if (!dm_hash_insert(fid->metadata_areas_index,
+			    full_key, mda)) {
+		log_error("Failed to hash mda.");
+		return 0;
+	}
 
 	return 1;
 }


             reply	other threads:[~2012-02-28 11:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-28 11:13 zkabelac [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-07-20 15:22 meyering
2004-11-24 20:37 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=20120228111300.4118.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: 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).