]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Fix the CTL OOA queue dumping code so that it does not hold a mutex
authorKenneth D. Merry <ken@FreeBSD.org>
Sat, 8 Dec 2012 04:16:07 +0000 (04:16 +0000)
committerKenneth D. Merry <ken@FreeBSD.org>
Sat, 8 Dec 2012 04:16:07 +0000 (04:16 +0000)
commitc67e7549515501dbb39018c26f3f46e710a8f0e8
tree1a03669a531ed908f12c8c71bfa420b6a18d68c4
parent86d45c7f3b33e9d0c1a8ec5deaaddf22829d785f
Fix the CTL OOA queue dumping code so that it does not hold a mutex
while doing a copyout.  That can cause a panic, because copyout
can trigger VM faults, and we can't handle VM faults while holding
a mutex.

The solution here is to malloc a separate buffer to hold the OOA
queue entries, so that we don't risk a VM fault while filling up
the buffer and we don't have to drop the lock.  The other solution
would be to wire the user's memory while filling their buffer with
copyout, but that would have been a little more complex.

Also fix a debugging parenthesis issue in ctl_abort_task() pointed
out by Chuck Tuffli.

Sponsored by: Spectra Logic Corporation
MFC after: 1 week
sys/cam/ctl/ctl.c