From ad3e75f51edb275ecaa78bf716f7148a4f647f6d Mon Sep 17 00:00:00 2001 From: jhb Date: Mon, 5 May 2003 21:27:29 +0000 Subject: Tweak the clearing of TDF_DEADLKTREAT so that we only bother grabbing the lock and clearing the flag if it was clear when uiomove() was called. --- sys/kern/kern_subr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/kern/kern_subr.c') diff --git a/sys/kern/kern_subr.c b/sys/kern/kern_subr.c index 9e47e4e..0a3052c 100644 --- a/sys/kern/kern_subr.c +++ b/sys/kern/kern_subr.c @@ -185,9 +185,9 @@ uiomove(void *cp, int n, struct uio *uio) n -= cnt; } out: - if (td) { + if (td && save == 0) { mtx_lock_spin(&sched_lock); - td->td_flags = (td->td_flags & ~TDF_DEADLKTREAT) | save; + td->td_flags &= ~TDF_DEADLKTREAT; mtx_unlock_spin(&sched_lock); } return (error); -- cgit v1.1