remove dropbox attribute leak fix

change 6ec1846164, 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.

(cherry picked from commit 142883cae8)

Change-Id: Id3a03e7b3982abb3947c9b3d1baa46c828169cdb
Reviewed-on: http://gerrit.openafs.org/1389
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
This commit is contained in:
Derrick Brashear 2010-02-24 11:20:51 -05:00
parent 2057e796df
commit 82124f7e85

View File

@ -188,6 +188,7 @@ afs_getattr(OSI_VC_DECL(avc), struct vattr *attrs, struct AFS_UCRED *acred)
struct vrequest treq;
extern struct unixuser *afs_FindUser();
struct unixuser *au;
int inited = 0;
OSI_VC_CONVERT(avc);
AFS_STATCNT(afs_getattr);
@ -211,23 +212,15 @@ afs_getattr(OSI_VC_DECL(avc), struct vattr *attrs, struct AFS_UCRED *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->states & CUBCinit)
#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)
if (flags & ATTR_HINT) {
code = afs_CopyOutAttrs(avc, attrs);
return code;
}
#endif
#if defined(AFS_DARWIN_ENV) && !defined(AFS_DARWIN80_ENV)
if (avc->states & CUBCinit) {
code = afs_CopyOutAttrs(avc, attrs);
return code;
}
#endif
@ -239,11 +232,13 @@ afs_getattr(OSI_VC_DECL(avc), struct vattr *attrs, struct AFS_UCRED *acred)
if (afs_shuttingdown)
return EIO;
code = afs_InitReq(&treq, acred);
if (code == 0 && !(avc->states & CStatd)) {
if (!(avc->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)
@ -251,17 +246,17 @@ afs_getattr(OSI_VC_DECL(avc), struct vattr *attrs, struct AFS_UCRED *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,