From: Andrew Deason Date: Fri, 25 Mar 2011 20:54:01 +0000 (-0500) Subject: viced: REALLYCLOSE origfdP after CoW X-Git-Tag: upstream/1.8.0_pre1^2~3993 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=55781a831954cb1e7253a12e0f9b581b586c3603;p=packages%2Fo%2Fopenafs.git viced: REALLYCLOSE origfdP after CoW In StoreData_RXStyle, we save a pointer to the original FdHandle_t if we need to CopyOnWrite the target vnode, for the purposes of possibly copying additional data later on. After the CopyOnWrite call, this points to an inode that is not in the current volume, and is thus less likely to be accessed. In CopyOnWrite itself, the original file handle is FDH_REALLYCLOSE'd because of this, so the handle does not remain in the cache. Do the same in StoreData_RXStyle, so origfdP is always FDH_REALLYCLOSE'd after we have called CopyOnWrite. Change-Id: Ibe33d26120eb354318147f3a31fe32d38c6a70c6 Reviewed-on: http://gerrit.openafs.org/4344 Reviewed-by: Jeffrey Altman Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- diff --git a/src/viced/afsfileprocs.c b/src/viced/afsfileprocs.c index 71ea49b91..a8f9975ab 100644 --- a/src/viced/afsfileprocs.c +++ b/src/viced/afsfileprocs.c @@ -7464,7 +7464,7 @@ StoreData_RXStyle(Volume * volptr, Vnode * targetptr, struct AFSFid * Fid, if (fdP == NULL) { ViceLog(25, ("StoreData : Reopen after CopyOnWrite failed\n")); - FDH_CLOSE(origfdP); + FDH_REALLYCLOSE(origfdP); return ENOENT; } } @@ -7496,7 +7496,7 @@ StoreData_RXStyle(Volume * volptr, Vnode * targetptr, struct AFSFid * Fid, AdjustDiskUsage(volptr, adjustSize, adjustSize - SpareComp(volptr)))) { FDH_CLOSE(fdP); - if (origfdP) FDH_CLOSE(origfdP); + if (origfdP) FDH_REALLYCLOSE(origfdP); return (errorCode); } @@ -7596,7 +7596,7 @@ StoreData_RXStyle(Volume * volptr, Vnode * targetptr, struct AFSFid * Fid, targetptr->changed_newTime = 1; if (origfdP && (bytesTransfered < Length)) /* Need to "finish" CopyOnWrite still */ CopyOnWrite2(origfdP, fdP, Pos + bytesTransfered, NewLength - Pos - bytesTransfered); - if (origfdP) FDH_CLOSE(origfdP); + if (origfdP) FDH_REALLYCLOSE(origfdP); FDH_CLOSE(fdP); /* set disk usage to be correct */ VAdjustDiskUsage(&errorCode, volptr, @@ -7613,7 +7613,7 @@ StoreData_RXStyle(Volume * volptr, Vnode * targetptr, struct AFSFid * Fid, afs_printable_VnodeId_u(targetptr->vnodeNumber), V_name(volptr), CoW_off, CoW_len, errorCode)); } - FDH_CLOSE(origfdP); + FDH_REALLYCLOSE(origfdP); } FDH_CLOSE(fdP);