honor-solaris-attr-hint-20010112
authorNickolai Zeldovich <kolya@mit.edu>
Fri, 12 Jan 2001 06:31:43 +0000 (06:31 +0000)
committerDerrick Brashear <shadow@dementia.org>
Fri, 12 Jan 2001 06:31:43 +0000 (06:31 +0000)
"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."

src/afs/VNOPS/afs_vnop_attrs.c

index 0ae402a..3467519 100644 (file)
@@ -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