fq - fix a (possible) deadlock
authorAlex Hornung <ahornung@gmail.com>
Fri, 26 Aug 2011 00:29:17 +0000 (00:29 +0000)
committerAlex Hornung <ahornung@gmail.com>
Sat, 27 Aug 2011 10:33:50 +0000 (10:33 +0000)
commit009da86a5800b6fefcda0a946ab02a089bd9254f
treee162b580145462aaad68aa29402a0aaaf2c1029d
parent51d59e22772ee61a216fe2782d1fcc262b27844c
fq - fix a (possible) deadlock

 * A deadlock can occur if a lock is held around the strategy call when
   the completion is synchronous and ends up in the destruction of a
   tdio, as both will acquire the same diskctx lock.

 * Refactor the code around strategy calls so that the bios are first
   prepared, under the protection of the lock, and inserted into a local
   array. Once that is ready and the bios are ready and taken out of
   their respective queues, the locks are dropped and the strategy call
   occurs locklessly.

Reported-by: Antonio Huete (tuxillo@)
sys/kern/dsched/fq/fq.h
sys/kern/dsched/fq/fq_core.c
sys/kern/dsched/fq/fq_diskops.c