Source-Changes-HG archive

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

[src/trunk]: src/sys/dev pacify disklabel validation message



details:   https://anonhg.NetBSD.org/src/rev/93bcb0c01f15
branches:  trunk
changeset: 822003:93bcb0c01f15
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Sat Feb 25 15:19:00 2017 +0000

description:
pacify disklabel validation message

diffstat:

 sys/dev/dksubr.c |  13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diffs (38 lines):

diff -r 97d637275f9e -r 93bcb0c01f15 sys/dev/dksubr.c
--- a/sys/dev/dksubr.c  Sat Feb 25 13:34:21 2017 +0000
+++ b/sys/dev/dksubr.c  Sat Feb 25 15:19:00 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dksubr.c,v 1.94 2016/12/22 13:42:14 mlelstv Exp $ */
+/* $NetBSD: dksubr.c,v 1.95 2017/02/25 15:19:00 mlelstv Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 1999, 2002, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dksubr.c,v 1.94 2016/12/22 13:42:14 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dksubr.c,v 1.95 2017/02/25 15:19:00 mlelstv Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -888,13 +888,16 @@
                return;
 
        /* Sanity check */
-       if (lp->d_secperunit < UINT32_MAX ?
-               lp->d_secperunit != dg->dg_secperunit :
-               lp->d_secperunit > dg->dg_secperunit)
+       if (lp->d_secperunit > dg->dg_secperunit)
                printf("WARNING: %s: total sector size in disklabel (%ju) "
                    "!= the size of %s (%ju)\n", dksc->sc_xname,
                    (uintmax_t)lp->d_secperunit, dksc->sc_xname,
                    (uintmax_t)dg->dg_secperunit);
+       else if (lp->d_secperunit < UINT32_MAX &&
+                lp->d_secperunit < dg->dg_secperunit)
+               printf("%s: %ju trailing sectors not covered by disklabel\n",
+                   dksc->sc_xname,
+                   (uintmax_t)dg->dg_secperunit - lp->d_secperunit);
 
        for (i=0; i < lp->d_npartitions; i++) {
                pp = &lp->d_partitions[i];



Home | Main Index | Thread Index | Old Index