mirror of
https://git.openafs.org/openafs.git
synced 2025-01-22 17:00:15 +00:00
viced: Do not swallow errors on StoreData recovery
When we encounter any error in the StoreData fetch/store loop, we reset the disk usage to ensure it remains correct, even in the face of unexpected errors. However, when we do so, we use the errorCode from VAdjustDiskUsage as our return value; if it is 0, we return success, ignoring the error that got us in this code path in the first place. Instead, keep track of a temporary errorCode for the disk usage adjustment, and do not override our return value if there was no error in the disk usage numbers. Change-Id: Ifbe2377f2750b508d48e535215be3583d1d78e65 Reviewed-on: http://gerrit.openafs.org/5645 Reviewed-by: Derrick Brashear <shadow@dementix.org> Tested-by: Derrick Brashear <shadow@dementix.org>
This commit is contained in:
parent
55efff93fe
commit
dd831c0960
@ -6586,6 +6586,7 @@ StoreData_RXStyle(Volume * volptr, Vnode * targetptr, struct AFSFid * Fid,
|
|||||||
FDH_SYNC(fdP);
|
FDH_SYNC(fdP);
|
||||||
}
|
}
|
||||||
if (errorCode) {
|
if (errorCode) {
|
||||||
|
Error tmp_errorCode = 0;
|
||||||
afs_sfsize_t nfSize = FDH_SIZE(fdP);
|
afs_sfsize_t nfSize = FDH_SIZE(fdP);
|
||||||
osi_Assert(nfSize >= 0);
|
osi_Assert(nfSize >= 0);
|
||||||
/* something went wrong: adjust size and return */
|
/* something went wrong: adjust size and return */
|
||||||
@ -6599,9 +6600,12 @@ StoreData_RXStyle(Volume * volptr, Vnode * targetptr, struct AFSFid * Fid,
|
|||||||
if (origfdP) FDH_REALLYCLOSE(origfdP);
|
if (origfdP) FDH_REALLYCLOSE(origfdP);
|
||||||
FDH_CLOSE(fdP);
|
FDH_CLOSE(fdP);
|
||||||
/* set disk usage to be correct */
|
/* set disk usage to be correct */
|
||||||
VAdjustDiskUsage(&errorCode, volptr,
|
VAdjustDiskUsage(&tmp_errorCode, volptr,
|
||||||
(afs_sfsize_t) (nBlocks(nfSize) -
|
(afs_sfsize_t) (nBlocks(nfSize) -
|
||||||
nBlocks(NewLength)), 0);
|
nBlocks(NewLength)), 0);
|
||||||
|
if (tmp_errorCode) {
|
||||||
|
errorCode = tmp_errorCode;
|
||||||
|
}
|
||||||
return errorCode;
|
return errorCode;
|
||||||
}
|
}
|
||||||
if (origfdP) { /* finish CopyOnWrite */
|
if (origfdP) { /* finish CopyOnWrite */
|
||||||
|
Loading…
Reference in New Issue
Block a user