Module Name: src
Committed By: joerg
Date: Fri Oct 16 21:00:41 UTC 2009
Modified Files:
src/external/gpl2/lvm2/dist/lib/device: dev-cache.c
src/external/gpl2/lvm2/dist/lib/netbsd: dev.c
Log Message:
Only match raw devices. Only match against the char major as extracted
from the kernel. Prevents aliasing nwt0 and rwd0e. OK haad@
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl2/lvm2/dist/lib/device/dev-cache.c
cvs rdiff -u -r1.1 -r1.2 src/external/gpl2/lvm2/dist/lib/netbsd/dev.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/external/gpl2/lvm2/dist/lib/device/dev-cache.c
diff -u src/external/gpl2/lvm2/dist/lib/device/dev-cache.c:1.2 src/external/gpl2/lvm2/dist/lib/device/dev-cache.c:1.3
--- src/external/gpl2/lvm2/dist/lib/device/dev-cache.c:1.2 Mon Dec 22 00:56:58 2008
+++ src/external/gpl2/lvm2/dist/lib/device/dev-cache.c Fri Oct 16 21:00:41 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: dev-cache.c,v 1.2 2008/12/22 00:56:58 haad Exp $ */
+/* $NetBSD: dev-cache.c,v 1.3 2009/10/16 21:00:41 joerg Exp $ */
/*
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
@@ -435,11 +435,14 @@
* raw and block. I can insert only existing
* raw and block device.
*/
+ if (S_ISBLK(info.st_mode)) {
+ log_debug("%s: Not a raw device", path);
+ return_0;
+ }
if (nbsd_check_dev(MAJOR(info.st_rdev),path) < 0) {
- log_debug("%s: Not a block device.", path);
+ log_debug("%s: Not a known raw device", path);
return_0;
}
-
#else
if (!S_ISBLK(info.st_mode))
log_debug("%s: Not a block device", path);
Index: src/external/gpl2/lvm2/dist/lib/netbsd/dev.c
diff -u src/external/gpl2/lvm2/dist/lib/netbsd/dev.c:1.1 src/external/gpl2/lvm2/dist/lib/netbsd/dev.c:1.2
--- src/external/gpl2/lvm2/dist/lib/netbsd/dev.c:1.1 Mon Dec 22 00:56:59 2008
+++ src/external/gpl2/lvm2/dist/lib/netbsd/dev.c Fri Oct 16 21:00:41 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: dev.c,v 1.1 2008/12/22 00:56:59 haad Exp $ */
+/* $NetBSD: dev.c,v 1.2 2009/10/16 21:00:41 joerg Exp $ */
/*
* NetBSD specific device routines are added to this file.
@@ -61,11 +61,7 @@
if (kd[i].d_cmajor != -1 && kd[i].d_bmajor != -1) {
if (kd[i].d_cmajor == major)
- return kd[i].d_bmajor;
-
- if (kd[i].d_bmajor == major)
- return kd[i].d_cmajor;
-
+ return 0;
}
return LVM_FAILURE;