Skip to contentSkip to conversation

LVM2/lib/activate fs.c

PATCH [email protected] 1 participant 1 message Aug 3, 2009

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: agk at sourceware.org 2009-08-03 18:31:53

Modified files:
lib/activate : fs.c

Log message:
Add warnings to check udev did what it was meant to.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/fs.c.diff?cvsroot=lvm2&r1=1.44&r2=1.45

lib/activate/fs.c +8 -3
@@ -194,9 +194,14 @@
 		return 0;
 	}
 
-	if (lstat(lv_path, &buf) || !S_ISLNK(buf.st_mode)) {
-		if (errno == ENOENT)
-			return 1;
+	if (lstat(lv_path, &buf) && errno == ENOENT)
+		return 1;
+	else if (dm_udev_get_sync_support())
+		log_warn("The link %s should have been removed by udev "
+			 "but it is still present. Falling back to "
+			 "direct link removal.", lv_path);
+
+	if (!S_ISLNK(buf.st_mode)) {
 		log_error("%s not symbolic link - not removing", lv_path);
 		return 0;
 	}