Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/raidframe check the result of pool_prime.



details:   https://anonhg.NetBSD.org/src/rev/da8925ad8750
branches:  trunk
changeset: 827841:da8925ad8750
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Nov 14 14:27:54 2017 +0000

description:
check the result of pool_prime.

diffstat:

 sys/dev/raidframe/rf_netbsdkintf.c |  9 ++++++---
 sys/dev/raidframe/rf_reconmap.c    |  8 +++++---
 2 files changed, 11 insertions(+), 6 deletions(-)

diffs (68 lines):

diff -r ef875efaa955 -r da8925ad8750 sys/dev/raidframe/rf_netbsdkintf.c
--- a/sys/dev/raidframe/rf_netbsdkintf.c        Tue Nov 14 14:15:29 2017 +0000
+++ b/sys/dev/raidframe/rf_netbsdkintf.c        Tue Nov 14 14:27:54 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_netbsdkintf.c,v 1.351 2017/11/09 01:02:56 christos Exp $    */
+/*     $NetBSD: rf_netbsdkintf.c,v 1.352 2017/11/14 14:27:54 christos 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.351 2017/11/09 01:02:56 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.352 2017/11/14 14:27:54 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -3575,9 +3575,12 @@
 rf_pool_init(struct pool *p, size_t size, const char *w_chan,
             size_t xmin, size_t xmax)
 {
+       int error;
+
        pool_init(p, size, 0, 0, 0, w_chan, NULL, IPL_BIO);
        pool_sethiwat(p, xmax);
-       pool_prime(p, xmin);
+       if ((error = pool_prime(p, xmin)) != 0)
+               panic("%s: failed to prime pool: %d", __func__, error);
        pool_setlowat(p, xmin);
 }
 
diff -r ef875efaa955 -r da8925ad8750 sys/dev/raidframe/rf_reconmap.c
--- a/sys/dev/raidframe/rf_reconmap.c   Tue Nov 14 14:15:29 2017 +0000
+++ b/sys/dev/raidframe/rf_reconmap.c   Tue Nov 14 14:27:54 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_reconmap.c,v 1.35 2017/01/04 15:51:41 christos Exp $        */
+/*     $NetBSD: rf_reconmap.c,v 1.36 2017/11/14 14:27:54 christos Exp $        */
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -34,7 +34,7 @@
  *************************************************************************/
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_reconmap.c,v 1.35 2017/01/04 15:51:41 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_reconmap.c,v 1.36 2017/11/14 14:27:54 christos Exp $");
 
 #include "rf_raid.h"
 #include <sys/time.h>
@@ -86,6 +86,7 @@
        RF_RaidLayout_t *layoutPtr = &raidPtr->Layout;
        RF_ReconUnitCount_t num_rus = layoutPtr->stripeUnitsPerDisk / layoutPtr->SUsPerRU;
        RF_ReconMap_t *p;
+       int error;
 
        RF_Malloc(p, sizeof(RF_ReconMap_t), (RF_ReconMap_t *));
        p->sectorsPerReconUnit = ru_sectors;
@@ -107,7 +108,8 @@
 
        pool_init(&p->elem_pool, sizeof(RF_ReconMapListElem_t), 0,
            0, 0, "raidreconpl", NULL, IPL_BIO);
-       pool_prime(&p->elem_pool, RF_NUM_RECON_POOL_ELEM);
+       if ((error = pool_prime(&p->elem_pool, RF_NUM_RECON_POOL_ELEM)) != 0)
+               panic("%s: failed to prime pool: %d", __func__, error);
 
        rf_init_mutex2(p->mutex, IPL_VM);
        rf_init_cond2(p->cv, "reconupdate");



Home | Main Index | Thread Index | Old Index