Fix readonly check for vdev user properties

VDEV_PROP_USERPROP is equal do VDEV_PROP_INVAL and so is not a real
property.  That's why vdev_prop_readonly() does not work right for
it.  In particular it may declare all vdev user properties readonly
on FreeBSD.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Rob Norris <robn@despairlabs.com>
Signed-off-by:	Alexander Motin <mav@FreeBSD.org>
Sponsored by:	iXsystems, Inc.
Closes #16890
This commit is contained in:
Alexander Motin 2024-12-20 17:25:35 -05:00 committed by GitHub
parent 219a89cbbf
commit 1acd246964
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -5969,7 +5969,7 @@ vdev_prop_set(vdev_t *vd, nvlist_t *innvl, nvlist_t *outnvl)
goto end;
}
if (vdev_prop_readonly(prop)) {
if (prop != VDEV_PROP_USERPROP && vdev_prop_readonly(prop)) {
error = EROFS;
goto end;
}