OSDN Git Service

NFS: Don't deadlock when cookie hashes collide
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Tue, 22 Mar 2022 02:27:13 +0000 (22:27 -0400)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Tue, 22 Mar 2022 13:14:39 +0000 (09:14 -0400)
commit648a4548d622c4ae965058db1a6b5b95c062789a
tree75b1b27ae64b689ebeddcb4093ef63786a5b3ca7
parenta43bf604446414103b7535f38e739b65601c4fb2
NFS: Don't deadlock when cookie hashes collide

In the very rare case where the readdir reply contains multiple cookies
that map to the same hash value, we can end up deadlocking waiting for a
page lock that we already hold. In this case we should fail the page
lock by using grab_cache_page_nowait().

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/dir.c