Remove a spourious Giant acquisition.
The code seems pretty MPSAFE and Giant is held over kproc_exit() which at lowel calls exit1(). exit1() requires Giant to be unowned so this opens a window for races. Reported by: Bryan Venteicher <bryanv at daemoninthecloset dot org> Tested by: Bryan Venteicher <bryanv at daemoninthecloset dot org>
This commit is contained in:
parent
303d3f35fb
commit
100a4abc46
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=176566
@ -652,7 +652,6 @@ smb_iod_thread(void *arg)
|
||||
{
|
||||
struct smbiod *iod = arg;
|
||||
|
||||
mtx_lock(&Giant);
|
||||
/*
|
||||
* Here we assume that the thread structure will be the same
|
||||
* for an entire kthread (kproc, to be more precise) life.
|
||||
@ -662,12 +661,10 @@ smb_iod_thread(void *arg)
|
||||
while ((iod->iod_flags & SMBIOD_SHUTDOWN) == 0) {
|
||||
smb_iod_main(iod);
|
||||
SMBIODEBUG("going to sleep for %d ticks\n", iod->iod_sleeptimo);
|
||||
/* mtx_unlock(&Giant, MTX_DEF);*/
|
||||
if (iod->iod_flags & SMBIOD_SHUTDOWN)
|
||||
break;
|
||||
tsleep(&iod->iod_flags, PWAIT, "90idle", iod->iod_sleeptimo);
|
||||
}
|
||||
/* mtx_lock(&Giant, MTX_DEF);*/
|
||||
kproc_exit(0);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user