From 7faf596b439cce022cfa4b3174cd17a1f0a0901e Mon Sep 17 00:00:00 2001 From: Jeffrey Hutzelman Date: Wed, 9 Apr 2008 14:38:47 +0000 Subject: [PATCH] linux-nfstrans-avoid-access-deadlock-20080409 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 | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/afs/VNOPS/afs_vnop_access.c b/src/afs/VNOPS/afs_vnop_access.c index a5cd799145..7e2cd7325b 100644 --- a/src/afs/VNOPS/afs_vnop_access.c +++ b/src/afs/VNOPS/afs_vnop_access.c @@ -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 */