]> granicus.if.org Git - zfs/commit
Handle closing an unopened ZVOL
authorBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 8 Mar 2013 18:48:18 +0000 (10:48 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 30 Jan 2015 22:44:14 +0000 (14:44 -0800)
commit0365064a9726f6bb6e148611a6e42fa80302d083
tree528aa5f09032350ba036ffc1d670c82ab7aa1591
parenta127e841dee20340b300e98b6d4b62f9ad41a47b
Handle closing an unopened ZVOL

Thank to commit a4430fce691d492aec382de0dfa937c05ee16500 we're
now correctly returning EROFS when opening a zvol on a read-only
pool.  Unfortunately, it looks like this causes us to trigger
some unexpected behavior by __blkdev_get().

In the failure case it's possible __blkdev_get() will call
__blkdev_put() for a bdev which was never successfully opened.
This results in us trying to close the device again and hitting
the NULL dereference.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #1343
module/zfs/zvol.c