From: Andrew Deason Date: Fri, 25 Mar 2011 20:54:01 +0000 (-0500) Subject: viced: REALLYCLOSE origfdP after CoW X-Git-Tag: upstream/1.6.0.pre4^2~2 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=8f7ae330d6491dae015c52ae1a3cf0e2333a349b;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. Reviewed-on: http://gerrit.openafs.org/4344 Reviewed-by: Jeffrey Altman Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear (cherry picked from commit 55781a831954cb1e7253a12e0f9b581b586c3603) Change-Id: I184a7e0b0ac05361c491821bc6a3756db3e24221 Reviewed-on: http://gerrit.openafs.org/4352 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- diff --git a/src/viced/afsfileprocs.c b/src/viced/afsfileprocs.c index 368b53b9f..9cbbff597 100644 --- a/src/viced/afsfileprocs.c +++ b/src/viced/afsfileprocs.c @@ -7360,7 +7360,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; } } @@ -7392,7 +7392,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); } @@ -7492,7 +7492,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, @@ -7509,7 +7509,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);