Source-Changes-HG archive

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

[src/trunk]: src/sys/dev No longer warn about differences bewteen disk size a...



details:   https://anonhg.NetBSD.org/src/rev/e2f40a2b6a2b
branches:  trunk
changeset: 332901:e2f40a2b6a2b
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Sat Oct 11 12:36:25 2014 +0000

description:
No longer warn about differences bewteen disk size and total sector count
in disklabel when the latter is just clamped to the maximum.

diffstat:

 sys/dev/ccd.c                      |   8 +++++---
 sys/dev/dksubr.c                   |  20 ++++++++++++--------
 sys/dev/raidframe/rf_netbsdkintf.c |  20 ++++++++++++--------
 3 files changed, 29 insertions(+), 19 deletions(-)

diffs (121 lines):

diff -r e59751e7950a -r e2f40a2b6a2b sys/dev/ccd.c
--- a/sys/dev/ccd.c     Sat Oct 11 12:06:58 2014 +0000
+++ b/sys/dev/ccd.c     Sat Oct 11 12:36:25 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ccd.c,v 1.153 2014/10/11 12:01:27 mlelstv Exp $        */
+/*     $NetBSD: ccd.c,v 1.154 2014/10/11 12:36:25 mlelstv Exp $        */
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 1999, 2007, 2009 The NetBSD Foundation, Inc.
@@ -88,7 +88,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ccd.c,v 1.153 2014/10/11 12:01:27 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ccd.c,v 1.154 2014/10/11 12:36:25 mlelstv Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -1552,7 +1552,9 @@
                 * same componets are used, and old disklabel may used
                 * if that is found.
                 */
-               if (lp->d_secperunit != cs->sc_size)
+               if (lp->d_secperunit < UINT32_MAX ?
+                       lp->d_secperunit != cs->sc_size :
+                       lp->d_secperunit > cs->sc_size)
                        printf("WARNING: %s: "
                            "total sector size in disklabel (%ju) != "
                            "the size of ccd (%ju)\n", cs->sc_xname,
diff -r e59751e7950a -r e2f40a2b6a2b sys/dev/dksubr.c
--- a/sys/dev/dksubr.c  Sat Oct 11 12:06:58 2014 +0000
+++ b/sys/dev/dksubr.c  Sat Oct 11 12:36:25 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dksubr.c,v 1.52 2014/10/11 12:01:27 mlelstv Exp $ */
+/* $NetBSD: dksubr.c,v 1.53 2014/10/11 12:36:25 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.52 2014/10/11 12:01:27 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dksubr.c,v 1.53 2014/10/11 12:36:25 mlelstv Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -583,17 +583,21 @@
                return;
 
        /* Sanity check */
-       if (lp->d_secperunit != dg->dg_secperunit)
-               printf("WARNING: %s: total sector size in disklabel (%d) "
-                   "!= the size of %s (%" PRId64 ")\n", dksc->sc_xname,
-                   lp->d_secperunit, di->di_dkname, dg->dg_secperunit);
+       if (lp->d_secperunit < UINT32_MAX ?
+               lp->d_secperunit != dg->dg_secperunit :
+               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, di->di_dkname,
+                   (uintmax_t)dg->dg_secperunit);
 
        for (i=0; i < lp->d_npartitions; i++) {
                pp = &lp->d_partitions[i];
                if (pp->p_offset + pp->p_size > dg->dg_secperunit)
                        printf("WARNING: %s: end of partition `%c' exceeds "
-                           "the size of %s (%" PRId64 ")\n", dksc->sc_xname,
-                           'a' + i, di->di_dkname, dg->dg_secperunit);
+                           "the size of %s (%ju)\n", dksc->sc_xname,
+                           'a' + i, di->di_dkname,
+                           (uintmax_t)dg->dg_secperunit);
        }
 }
 
diff -r e59751e7950a -r e2f40a2b6a2b sys/dev/raidframe/rf_netbsdkintf.c
--- a/sys/dev/raidframe/rf_netbsdkintf.c        Sat Oct 11 12:06:58 2014 +0000
+++ b/sys/dev/raidframe/rf_netbsdkintf.c        Sat Oct 11 12:36:25 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_netbsdkintf.c,v 1.313 2014/10/11 12:01:27 mlelstv Exp $     */
+/*     $NetBSD: rf_netbsdkintf.c,v 1.314 2014/10/11 12:36:25 mlelstv Exp $     */
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2008-2011 The NetBSD Foundation, Inc.
@@ -101,7 +101,7 @@
  ***********************************************************/
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.313 2014/10/11 12:01:27 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.314 2014/10/11 12:36:25 mlelstv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -2440,17 +2440,21 @@
                 * same components are used, and old disklabel may used
                 * if that is found.
                 */
-               if (lp->d_secperunit != rs->sc_size)
+               if (lp->d_secperunit < UINT32_MAX ?
+                   lp->d_secperunit != rs->sc_size :
+                   lp->d_secperunit > rs->sc_size)
                        printf("raid%d: WARNING: %s: "
-                           "total sector size in disklabel (%" PRIu32 ") != "
-                           "the size of raid (%" PRIu64 ")\n", unit, rs->sc_xname,
-                           lp->d_secperunit, rs->sc_size);
+                           "total sector size in disklabel (%ju) != "
+                           "the size of raid (%ju)\n", unit, rs->sc_xname,
+                           (uintmax_t)lp->d_secperunit,
+                           (uintmax_t)rs->sc_size);
                for (i = 0; i < lp->d_npartitions; i++) {
                        pp = &lp->d_partitions[i];
                        if (pp->p_offset + pp->p_size > rs->sc_size)
                                printf("raid%d: WARNING: %s: end of partition `%c' "
-                                      "exceeds the size of raid (%" PRIu64 ")\n",
-                                      unit, rs->sc_xname, 'a' + i, rs->sc_size);
+                                      "exceeds the size of raid (%ju)\n",
+                                      unit, rs->sc_xname, 'a' + i,
+                                      (uintmax_t)rs->sc_size);
                }
        }
 



Home | Main Index | Thread Index | Old Index