From: Nickolai Zeldovich Date: Fri, 12 Jan 2001 06:31:43 +0000 (+0000) Subject: honor-solaris-attr-hint-20010112 X-Git-Tag: BP-openafs-devel-autoconf~119 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=22293eeada64329250864b4f46dfce3ca857f674;p=packages%2Fo%2Fopenafs.git honor-solaris-attr-hint-20010112 "The problem that it fixes is as follows: suppose user A's process maps something into its address space out of AFS. Now if user B runs "ps", or otherwise reads /proc/NNN/status, the kernel code will lock the associated entry in /proc and then proceed to find the size of the address space for that process; in doing so, it calls getattr(). If B does not have tokens to access the file, the fileserver will eventually start delaying responses to FetchStatus requests, and the kernel will block with /proc locked. The user-visible effect is that "ps", "w" and so on start blocking uninterruptibly for long periods of time." --- diff --git a/src/afs/VNOPS/afs_vnop_attrs.c b/src/afs/VNOPS/afs_vnop_attrs.c index 0ae402a88..34675191d 100644 --- a/src/afs/VNOPS/afs_vnop_attrs.c +++ b/src/afs/VNOPS/afs_vnop_attrs.c @@ -188,6 +188,13 @@ afs_getattr(OSI_VC_ARG(avc), attrs, acred) afs_Trace2(afs_iclSetp, CM_TRACE_GETATTR, ICL_TYPE_POINTER, avc, ICL_TYPE_INT32, avc->m.Length); +#if defined(AFS_SUN5_ENV) + if (flags & ATTR_HINT) { + code = afs_CopyOutAttrs(avc, attrs); + return code; + } +#endif + #if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV) afs_BozonLock(&avc->pvnLock, avc); #endif