Skip to content
Commit b2c0cea6 authored by J. Bruce Fields's avatar J. Bruce Fields
Browse files

nfsd4: check for negative dentry before use in nfsv4 readdir



After 2f9092e1 "Fix i_mutex vs.  readdir
handling in nfsd" (and 14f7dd63 "Copy XFS readdir hack into nfsd code"),
an entry may be removed between the first mutex_unlock and the second
mutex_lock. In this case, lookup_one_len() will return a negative
dentry.  Check for this case to avoid a NULL dereference.

Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
Reviewed-by: default avatarJ. R. Okajima <hooanon05@yahoo.co.jp>
Cc: stable@kernel.org
parent ccecee1e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment