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 <[email protected]>
Reviewed-by: Rob Norris <[email protected]>
Signed-off-by:	Alexander Motin <[email protected]>
Sponsored by:	iXsystems, Inc.
Closes #16890
This commit is contained in:
Alexander Motin authored and GitHub committed 2024-12-20 17:25:35 -05:00
1 parent 219a89cbbf
commit 1acd246964
1 file changed
+1 -1
+1 -1
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;
}