]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
remove dropbox attribute leak fix
authorDerrick Brashear <shadow@dementia.org>
Wed, 24 Feb 2010 16:13:23 +0000 (11:13 -0500)
committerDerrick Brashear <shadow@dementia.org>
Wed, 24 Feb 2010 16:14:56 +0000 (08:14 -0800)
change 6ec18461649d3e4f44b2476f886bcc480c456500, avoid leaking stat info,
appears to have side effects on at least macos, crashing the system
coreservicesd. revoke the change until the exact behavior we want is
better understood.

Change-Id: I2a270750f9cef5ac6ecf1144d86988f030f78efe
Reviewed-on: http://gerrit.openafs.org/1388
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
src/afs/VNOPS/afs_vnop_attrs.c

index b1c1fea4249166ecb735b22028fd0a8bc060a8cb..980611af5a7c5a91b40383da446082bab0da79b4 100644 (file)
@@ -189,6 +189,7 @@ afs_getattr(OSI_VC_DECL(avc), struct vattr *attrs, afs_ucred_t *acred)
     afs_int32 code;
     struct vrequest treq;
     struct unixuser *au;
+    int inited = 0;
     OSI_VC_CONVERT(avc);
 
     AFS_STATCNT(afs_getattr);
@@ -212,23 +213,15 @@ afs_getattr(OSI_VC_DECL(avc), struct vattr *attrs, afs_ucred_t *acred)
        afs_PutFakeStat(&fakestat);
        return code;
     }
-
-#if defined(AFS_SUN5_ENV) || defined(AFS_DARWIN_ENV) && !defined(AFS_DARWIN80_ENV)
 #if defined(AFS_SUN5_ENV)
-       if (flags & ATTR_HINT)
-#else
-       if (avc->f.states & CUBCinit)
+    if (flags & ATTR_HINT) {
+       code = afs_CopyOutAttrs(avc, attrs);
+       return code;
+    }
 #endif
-    {
-       if (!(code = afs_InitReq(&treq, acred))) {
-           if (vType(avc) != VDIR && vType(avc) != VLNK &&
-               !afs_AccessOK(avc, PRSFS_READ, &treq, DONT_CHECK_MODE_BITS)) {
-
-               code = EACCES;
-           }
-           if (!code)
-               code = afs_CopyOutAttrs(avc, attrs);
-       }
+#if defined(AFS_DARWIN_ENV) && !defined(AFS_DARWIN80_ENV)
+    if (avc->f.states & CUBCinit) {
+       code = afs_CopyOutAttrs(avc, attrs);
        return code;
     }
 #endif
@@ -242,11 +235,13 @@ afs_getattr(OSI_VC_DECL(avc), struct vattr *attrs, afs_ucred_t *acred)
     if (afs_shuttingdown)
        return EIO;
 
-    code = afs_InitReq(&treq, acred);
-
-    if (code == 0 && !(avc->f.states & CStatd)) {
-       code = afs_VerifyVCache2(avc, &treq);
-    }
+    if (!(avc->f.states & CStatd)) {
+       if (!(code = afs_InitReq(&treq, acred))) {
+           code = afs_VerifyVCache2(avc, &treq);
+           inited = 1;
+       }
+    } else
+       code = 0;
 
 #ifdef AFS_BOZONLOCK_ENV
     if (code == 0)
@@ -254,17 +249,17 @@ afs_getattr(OSI_VC_DECL(avc), struct vattr *attrs, afs_ucred_t *acred)
     afs_BozonUnlock(&avc->pvnLock, avc);
 #endif
 
-    if (code == 0 && vType(avc) != VDIR && vType(avc) != VLNK &&
-        !afs_AccessOK(avc, PRSFS_READ, &treq, DONT_CHECK_MODE_BITS)) {
-
-       code = EACCES;
-    }
 
     if (code == 0) {
        osi_FlushText(avc);     /* only needed to flush text if text locked last time */
        code = afs_CopyOutAttrs(avc, attrs);
 
        if (afs_nfsexporter) {
+           if (!inited) {
+               if ((code = afs_InitReq(&treq, acred)))
+                   return code;
+               inited = 1;
+           }
            if (AFS_NFSXLATORREQ(acred)) {
                if ((vType(avc) != VDIR)
                    && !afs_AccessOK(avc, PRSFS_READ, &treq,