HomeFreeBSD

zvol_os: Fix handling of zvol private data

Description

zvol_os: Fix handling of zvol private data

zvol private data is supposed to be nulled by zvol_clear_private before
zvol_free is called as an indicator that the zvol is going away.

Implement zvol_clear_private for volmode=dev.

Assert that zvol_clear_private has been called before zvol_free.

Check that zvol_clear_private has not been called when updating
volsize. If it has, fail with ENXIO.

Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Matt Macy <mmacy@FreeBSD.org>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #11117

Details

Provenance
freqlabsAuthored on Oct 21 2020, 6:09 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Oct 30 2020, 10:34 PM
Parents
rG277884ab428f: zvol_os: Don't leak doi in cdev error path
Branches
Unknown
Tags
Unknown

Event Timeline