zvol_check_volblocksize: fix spa ref leak

Reviewed-by: Allan Jude <allan@klarasystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
Reviewed-by: Fedor Uporov <fuporov.vstack@gmail.com>
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Sponsored-by: Klara, Inc.
Sponsored-by: Railway Corporation
Closes #17596
This commit is contained in:
Rob Norris 2025-07-25 13:17:18 +10:00 committed by Brian Behlendorf
parent 3e671f2353
commit e6eb03a991

View File

@ -450,8 +450,10 @@ zvol_check_volblocksize(const char *name, uint64_t volblocksize)
* We don't allow setting the property above 1MB,
* unless the tunable has been changed.
*/
if (volblocksize > zfs_max_recordsize)
if (volblocksize > zfs_max_recordsize) {
spa_close(spa, FTAG);
return (SET_ERROR(EDOM));
}
spa_close(spa, FTAG);
}