path: root/sys/sys
diff options
authorKonstantin Belousov <kib@FreeBSD.org>2020-02-22 20:50:30 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2020-02-22 20:50:30 +0000
commit0ff51c98d19739ee1c1e0046ffaade5051d6b210 (patch)
tree9ade0faeb4aee4a4c3118471e4af6dc46c9f418f /sys/sys
parent04869b812b8e19fbfbfd75299f3b00c186edb0d3 (diff)
Fix NFS client deadlock when read reports truncated node.
If node attribute returned in the reply for read rpc indicate truncation, and it happens that the vnode is exclusively locked, update of the node attributes would try to shrink vnode size. Since during the read some vnode pages were busied by the reading thread, vnode_pager_setsize() deadlocks waiting for the busy state owned by the caller. Use a thread-local flag to indicate that NFS read owns some (s)busy pages states and postpone the call to vnode_pager_setsize() until the thread relinguishes the ownership. Diagnosed by: rlibby Tested by: pho, rlibby Sponsored by: The FreeBSD Foundation MFC after: 1 week
Notes: svn path=/head/; revision=358252
Diffstat (limited to 'sys/sys')
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/sys/proc.h b/sys/sys/proc.h
index 2b574cb1c7b2..bbae5cf1caae 100644
--- a/sys/sys/proc.h
+++ b/sys/sys/proc.h
@@ -515,6 +515,8 @@ do { \
#define TDP_EXECVMSPC 0x40000000 /* Execve destroyed old vmspace */
#define TDP_SIGFASTPENDING 0x80000000 /* Pending signal due to sigfastblock */
+#define TDP2_SBPAGES 0x00000001 /* Owns sbusy on some pages */
* Reasons that the current thread can not be run yet.
* More than one may apply.