From 035c5d297bfb228c97757e418bddf19e93a19dea Mon Sep 17 00:00:00 2001 From: Nickolai Zeldovich Date: Fri, 19 Jan 2001 09:46:06 +0000 Subject: [PATCH] STABLE10-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." (cherry picked from commit 22293eeada64329250864b4f46dfce3ca857f674) --- src/afs/VNOPS/afs_vnop_attrs.c | 7 +++++++ 1 file changed, 7 insertions(+) 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 -- 2.39.5