From 76c1166357b64c8fc932a8ff0cee0425ae3ea719 Mon Sep 17 00:00:00 2001 From: christos Date: Fri, 31 Jul 2020 20:34:38 +0000 Subject: - don't overwrite existing error. - return the error not 0 if failing. --- sys/dev/raidframe/rf_netbsdkintf.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'sys/dev/raidframe') diff --git a/sys/dev/raidframe/rf_netbsdkintf.c b/sys/dev/raidframe/rf_netbsdkintf.c index a608bd33cc1..d3941fe9361 100644 --- a/sys/dev/raidframe/rf_netbsdkintf.c +++ b/sys/dev/raidframe/rf_netbsdkintf.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_netbsdkintf.c,v 1.386 2020/07/31 19:30:09 christos Exp $ */ +/* $NetBSD: rf_netbsdkintf.c,v 1.387 2020/07/31 20:34:38 christos Exp $ */ /*- * Copyright (c) 1996, 1997, 1998, 2008-2011 The NetBSD Foundation, Inc. @@ -101,7 +101,7 @@ ***********************************************************/ #include -__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.386 2020/07/31 19:30:09 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.387 2020/07/31 20:34:38 christos Exp $"); #ifdef _KERNEL_OPT #include "opt_raid_autoconfig.h" @@ -3673,7 +3673,7 @@ rf_sync_component_cache(RF_Raid_t *raidPtr, int c) printf("raid%d: cache flush[%d] to component %s failed (%d)\n", raidPtr->raidid, i, raidPtr->Disks[c].devname, e); } - return 0; + return e; } int @@ -3685,7 +3685,7 @@ rf_sync_component_caches(RF_Raid_t *raidPtr) for (c = 0; c < raidPtr->numCol; c++) { if (raidPtr->Disks[c].status == rf_ds_optimal) { int e = rf_sync_component_cache(raidPtr, c); - if (error == 0) + if (e && !error) error = e; } } @@ -3695,7 +3695,7 @@ rf_sync_component_caches(RF_Raid_t *raidPtr) /* Need to ensure that the reconstruct actually completed! */ if (raidPtr->Disks[sparecol].status == rf_ds_used_spare) { int e = rf_sync_component_cache(raidPtr, sparecol); - if (error == 0) + if (e && !error) error = e; continue; } -- cgit