Doug Ledford: Add warnings if we ever fail to get a lock on the mapfile.

Martin F. Krafft madduck at alioth.debian.org
Sun Aug 29 11:55:45 UTC 2010


Module: mdadm
Branch: upstream
Commit: 93c861ee5752896b340da51afb8ad4db95ae5e3b
URL:    http://git.debian.org/?p=pkg-mdadm/mdadm.git;a=commit;h=93c861ee5752896b340da51afb8ad4db95ae5e3b

Author: Doug Ledford <dledford at redhat.com>
Date:   Tue Jul 20 17:42:26 2010 -0400

Add warnings if we ever fail to get a lock on the mapfile.

Signed-off-by: Doug Ledford <dledford at redhat.com>

---

 Incremental.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/Incremental.c b/Incremental.c
index 35490e7..a8a072d 100644
--- a/Incremental.c
+++ b/Incremental.c
@@ -294,7 +294,9 @@ int Incremental(char *devname, int verbose, int runstop,
 
 	/* 4/ Check if array exists.
 	 */
-	map_lock(&map);
+	if (map_lock(&map))
+		fprintf(stderr, Name ": failed to get exclusive lock on "
+			"mapfile\n");
 	mp = map_by_uuid(&map, info.uuid);
 	if (mp)
 		mdfd = open_dev(mp->devnum);
@@ -793,7 +795,9 @@ int Incremental_container(struct supertype *st, char *devname, int verbose,
 	struct mdinfo *ra;
 	struct map_ent *map = NULL;
 
-	map_lock(&map);
+	if (map_lock(&map))
+		fprintf(stderr, Name ": failed to get exclusive lock on "
+			"mapfile\n");
 
 	for (ra = list ; ra ; ra = ra->next) {
 		int mdfd;




More information about the pkg-mdadm-commits mailing list