zvol_probe should return NULL when the device isn't found.

Previously we returned ERR_PTR(-ENOENT) which the rest of the kernel
doesn't expect and as such we can oops.

Signed-off-by: Chris Wedgwood <cw@f00f.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #949
Closes #931
Closes #789
Closes #743
Closes #730
This commit is contained in:
Chris Wedgwood 2012-09-24 10:30:18 -07:00 committed by Brian Behlendorf
parent 37abac6d55
commit 23a61ccc1b

View File

@ -1065,7 +1065,7 @@ zvol_probe(dev_t dev, int *part, void *arg)
mutex_enter(&zvol_state_lock); mutex_enter(&zvol_state_lock);
zv = zvol_find_by_dev(dev); zv = zvol_find_by_dev(dev);
kobj = zv ? get_disk(zv->zv_disk) : ERR_PTR(-ENOENT); kobj = zv ? get_disk(zv->zv_disk) : NULL;
mutex_exit(&zvol_state_lock); mutex_exit(&zvol_state_lock);
return kobj; return kobj;