]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
viced: REALLYCLOSE origfdP after CoW
authorAndrew Deason <adeason@sinenomine.net>
Fri, 25 Mar 2011 20:54:01 +0000 (15:54 -0500)
committerDerrick Brashear <shadow@dementia.org>
Mon, 28 Mar 2011 04:17:35 +0000 (21:17 -0700)
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 <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 55781a831954cb1e7253a12e0f9b581b586c3603)

Change-Id: I184a7e0b0ac05361c491821bc6a3756db3e24221
Reviewed-on: http://gerrit.openafs.org/4352
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
src/viced/afsfileprocs.c

index 368b53b9f7e3c137a76d9f7fef4bc94711753adb..9cbbff597f06c4546747f86da4e2a8441fd65b94 100644 (file)
@@ -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);