From 57134019771652937047519c4efd5f17b733190e Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Fri, 7 Oct 2005 20:30:21 +0000 Subject: [PATCH] viced-take-offline-on-ihopen-fail-20051007 when IH_OPEN fails, we should take the volume offline so it will be salvaged --- src/viced/afsfileprocs.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/viced/afsfileprocs.c b/src/viced/afsfileprocs.c index 84e4f313d..c19f92c5d 100644 --- a/src/viced/afsfileprocs.c +++ b/src/viced/afsfileprocs.c @@ -6759,14 +6759,17 @@ FetchData_RXStyle(Volume * volptr, Vnode * targetptr, TM_GetTimeOfDay(&StartTime, 0); ihP = targetptr->handle; fdP = IH_OPEN(ihP); - if (fdP == NULL) + if (fdP == NULL) { + VTakeOffline(volptr); return EIO; + } optSize = sendBufSize; tlen = FDH_SIZE(fdP); ViceLog(25, ("FetchData_RXStyle: file size %llu\n", (afs_uintmax_t) tlen)); if (tlen < 0) { FDH_CLOSE(fdP); + VTakeOffline(volptr); return EIO; } if (Pos > tlen) { @@ -6804,6 +6807,7 @@ FetchData_RXStyle(Volume * volptr, Vnode * targetptr, if (errorCode != wlen) { FDH_CLOSE(fdP); FreeSendBuffer((struct afs_buffer *)tbuffer); + VTakeOffline(volptr); return EIO; } errorCode = rx_Write(Call, tbuffer, wlen); @@ -6811,12 +6815,14 @@ FetchData_RXStyle(Volume * volptr, Vnode * targetptr, errorCode = rx_WritevAlloc(Call, tiov, &tnio, RX_MAXIOVECS, wlen); if (errorCode <= 0) { FDH_CLOSE(fdP); + VTakeOffline(volptr); return EIO; } wlen = errorCode; errorCode = FDH_READV(fdP, tiov, tnio); if (errorCode != wlen) { FDH_CLOSE(fdP); + VTakeOffline(volptr); return EIO; } errorCode = rx_Writev(Call, tiov, tnio, wlen); @@ -6988,6 +6994,7 @@ StoreData_RXStyle(Volume * volptr, Vnode * targetptr, struct AFSFid * Fid, return ENOENT; if (GetLinkCountAndSize(volptr, fdP, &linkCount, &DataLength) < 0) { FDH_CLOSE(fdP); + VTakeOffline(volptr); return EIO; } -- 2.39.5