From 71b8d6a6de5c2bb3e1b32ccd87f7aadb114f180f Mon Sep 17 00:00:00 2001 From: oster Date: Sat, 7 Oct 2006 17:42:53 +0000 Subject: It's ok to wait for memory for the emergency buffers. If we don't get that memory, fail harder, and bail on configuring the RAID array. Addresses PR#25787. --- sys/dev/raidframe/rf_driver.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'sys/dev/raidframe') diff --git a/sys/dev/raidframe/rf_driver.c b/sys/dev/raidframe/rf_driver.c index 500eb56e566..f6cfc052f18 100644 --- a/sys/dev/raidframe/rf_driver.c +++ b/sys/dev/raidframe/rf_driver.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_driver.c,v 1.110 2006/02/14 01:13:33 oster Exp $ */ +/* $NetBSD: rf_driver.c,v 1.111 2006/10/07 17:42:53 oster Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. * All rights reserved. @@ -73,7 +73,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: rf_driver.c,v 1.110 2006/02/14 01:13:33 oster Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_driver.c,v 1.111 2006/10/07 17:42:53 oster Exp $"); #include "opt_raid_diagnostic.h" @@ -462,7 +462,7 @@ rf_AllocEmergBuffers(RF_Raid_t *raidPtr) for (i = 0; i < raidPtr->numEmergencyBuffers; i++) { tmpbuf = malloc( raidPtr->Layout.sectorsPerStripeUnit << raidPtr->logBytesPerSector, - M_RAIDFRAME, M_NOWAIT); + M_RAIDFRAME, M_WAITOK); if (tmpbuf) { vple = rf_AllocVPListElem(); vple->p= tmpbuf; @@ -472,7 +472,7 @@ rf_AllocEmergBuffers(RF_Raid_t *raidPtr) } else { printf("raid%d: failed to allocate emergency buffer!\n", raidPtr->raidid); - break; + return 1; } } @@ -481,7 +481,7 @@ rf_AllocEmergBuffers(RF_Raid_t *raidPtr) for (i = 0; i < raidPtr->numEmergencyStripeBuffers; i++) { tmpbuf = malloc( raidPtr->numCol * (raidPtr->Layout.sectorsPerStripeUnit << raidPtr->logBytesPerSector), - M_RAIDFRAME, M_NOWAIT); + M_RAIDFRAME, M_WAITOK); if (tmpbuf) { vple = rf_AllocVPListElem(); vple->p= tmpbuf; @@ -491,7 +491,7 @@ rf_AllocEmergBuffers(RF_Raid_t *raidPtr) } else { printf("raid%d: failed to allocate emergency stripe buffer!\n", raidPtr->raidid); - break; + return 1; } } -- cgit