HomeFreeBSD

Handle closing an unopened ZVOL

Description

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

Details

Provenance
Brian Behlendorf <behlendorf1@llnl.gov>Authored on Mar 8 2013, 6:48 PM
Parents
rGa127e841dee2: Add zvol_open() error handling for readonly property
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rG0365064a9726: Handle closing an unopened ZVOL (authored by Brian Behlendorf <behlendorf1@llnl.gov>).Jan 30 2015, 10:44 PM