]> www.infradead.org Git - users/jedix/linux-maple.git/commit
xen-blkfront: fix a deadlock while handling discard response
authorLi Dongyang <lidongyang@novell.com>
Wed, 14 Sep 2011 06:02:40 +0000 (14:02 +0800)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Wed, 19 Oct 2011 20:31:15 +0000 (16:31 -0400)
commit4b1e7a4402548a8fafb21a0b2f7c9c77c99d8c70
treefc8814e8615be8f98911e35df7c05d658ff9c43b
parentbb6cc5dd41e47db8d91c1b0623a620c71049df75
xen-blkfront: fix a deadlock while handling discard response

When we get -EOPNOTSUPP response for a discard request, we will clear
the discard flag on the request queue so we won't attempt to send discard
requests to backend again, and this should be protected under rq->queue_lock.
However, when we setup the request queue, we pass blkif_io_lock to
blk_init_queue so rq->queue_lock is blkif_io_lock indeed, and this lock
is already taken when we are in blkif_interrpt, so remove the
spin_lock/spin_unlock when we clear the discard flag or we will end up
with deadlock here

Signed-off-by: Li Dongyang <lidongyang@novell.com>
[v1: Updated description a bit and removed comment from source]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
drivers/block/xen-blkfront.c