Module Name: src
Committed By: christos
Date: Tue Nov 14 14:27:54 UTC 2017
Modified Files:
src/sys/dev/raidframe: rf_netbsdkintf.c rf_reconmap.c
Log Message:
check the result of pool_prime.
To generate a diff of this commit:
cvs rdiff -u -r1.351 -r1.352 src/sys/dev/raidframe/rf_netbsdkintf.c
cvs rdiff -u -r1.35 -r1.36 src/sys/dev/raidframe/rf_reconmap.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/raidframe/rf_netbsdkintf.c
diff -u src/sys/dev/raidframe/rf_netbsdkintf.c:1.351 src/sys/dev/raidframe/rf_netbsdkintf.c:1.352
--- src/sys/dev/raidframe/rf_netbsdkintf.c:1.351 Wed Nov 8 20:02:56 2017
+++ src/sys/dev/raidframe/rf_netbsdkintf.c Tue Nov 14 09:27:54 2017
@@ -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 @@ void
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);
}
Index: src/sys/dev/raidframe/rf_reconmap.c
diff -u src/sys/dev/raidframe/rf_reconmap.c:1.35 src/sys/dev/raidframe/rf_reconmap.c:1.36
--- src/sys/dev/raidframe/rf_reconmap.c:1.35 Wed Jan 4 10:51:41 2017
+++ src/sys/dev/raidframe/rf_reconmap.c Tue Nov 14 09:27:54 2017
@@ -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_MakeReconMap(RF_Raid_t *raidPtr, RF_S
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 @@ rf_MakeReconMap(RF_Raid_t *raidPtr, RF_S
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");