Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/gpl2/lvm2/dist/lib Only match raw devices. Only mat...



details:   https://anonhg.NetBSD.org/src/rev/2576da073184
branches:  trunk
changeset: 748209:2576da073184
user:      joerg <joerg%NetBSD.org@localhost>
date:      Fri Oct 16 21:00:41 2009 +0000

description:
Only match raw devices. Only match against the char major as extracted
from the kernel. Prevents aliasing nwt0 and rwd0e. OK haad@

diffstat:

 external/gpl2/lvm2/dist/lib/device/dev-cache.c |  11 +++++++----
 external/gpl2/lvm2/dist/lib/netbsd/dev.c       |   8 ++------
 2 files changed, 9 insertions(+), 10 deletions(-)

diffs (49 lines):

diff -r 8a81558c85cb -r 2576da073184 external/gpl2/lvm2/dist/lib/device/dev-cache.c
--- a/external/gpl2/lvm2/dist/lib/device/dev-cache.c    Fri Oct 16 19:01:03 2009 +0000
+++ b/external/gpl2/lvm2/dist/lib/device/dev-cache.c    Fri Oct 16 21:00:41 2009 +0000
@@ -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 (nbsd_check_dev(MAJOR(info.st_rdev),path) < 0) {
-                       log_debug("%s: Not a block device.", path);
+               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 known raw device", path);
+                       return_0;
+               }
 #else
                if (!S_ISBLK(info.st_mode))
                        log_debug("%s: Not a block device", path);
diff -r 8a81558c85cb -r 2576da073184 external/gpl2/lvm2/dist/lib/netbsd/dev.c
--- a/external/gpl2/lvm2/dist/lib/netbsd/dev.c  Fri Oct 16 19:01:03 2009 +0000
+++ b/external/gpl2/lvm2/dist/lib/netbsd/dev.c  Fri Oct 16 21:00:41 2009 +0000
@@ -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;



Home | Main Index | Thread Index | Old Index