blkfront: Lock blkfront_info when closing
authorDaniel Stodden <daniel.stodden@citrix.com>
Fri, 30 Apr 2010 22:01:19 +0000 (22:01 +0000)
committerJens Axboe <jaxboe@fusionio.com>
Sat, 7 Aug 2010 16:38:43 +0000 (18:38 +0200)
The bdev .open/.release fops race against backend switches to Closing,
handled by the XenBus thread.

The original code attempted to serialize block device holders and
xenbus only via bd_mutex. This is insufficient, the info->bd pointer
may already be stale (or null) while xenbus tries to bump up the
refcount.

Protect blkfront_info with a dedicated mutex.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>

No differences found