linux-nfstrans-avoid-access-deadlock-20080409
authorJeffrey Hutzelman <jhutz@cmu.edu>
Wed, 9 Apr 2008 14:38:47 +0000 (14:38 +0000)
committerDerrick Brashear <shadow@dementia.org>
Wed, 9 Apr 2008 14:38:47 +0000 (14:38 +0000)
LICENSE IPL10

avoid deadlocking in access while we're already holding locks as filldir is doing its work

src/afs/VNOPS/afs_vnop_access.c

index a5cd799..7e2cd73 100644 (file)
@@ -224,11 +224,13 @@ afs_access(OSI_VC_DECL(avc), register afs_int32 amode,
        return code;
     }
 
-    code = afs_VerifyVCache(avc, &treq);
-    if (code) {
-       afs_PutFakeStat(&fakestate);
-       code = afs_CheckCode(code, &treq, 16);
-       return code;
+    if (vType(avc) != VDIR || !afs_InReadDir(avc)) {
+       code = afs_VerifyVCache(avc, &treq);
+       if (code) {
+           afs_PutFakeStat(&fakestate);
+           code = afs_CheckCode(code, &treq, 16);
+           return code;
+       }
     }
 
     /* if we're looking for write access and we have a read-only file system, report it */