From ded8f06a3cfee60b3a8ea5309e9c4d0e567ed3b5 Mon Sep 17 00:00:00 2001 From: LOLi Date: Tue, 12 Sep 2017 20:33:22 +0200 Subject: Relax (ref)reservation constraints on ZVOLs This change allow (ref)reservation to be set larger than the current ZVOL size: this is safe as we normally set refreservation > volsize at ZVOL creation time when we account for metadata. Reviewed-by: Brian Behlendorf Reviewed-by: George Melikov Reviewed by: Richard Elling Reviewed by: Matthew Ahrens Signed-off-by: loli10K Closes #2468 Closes #6610 --- lib/libzfs/libzfs_dataset.c | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'lib/libzfs') diff --git a/lib/libzfs/libzfs_dataset.c b/lib/libzfs/libzfs_dataset.c index 76a166038..3cf470759 100644 --- a/lib/libzfs/libzfs_dataset.c +++ b/lib/libzfs/libzfs_dataset.c @@ -1451,25 +1451,11 @@ badlabel: * checks to enforce. */ if (type == ZFS_TYPE_VOLUME && zhp != NULL) { - uint64_t volsize = zfs_prop_get_int(zhp, - ZFS_PROP_VOLSIZE); uint64_t blocksize = zfs_prop_get_int(zhp, ZFS_PROP_VOLBLOCKSIZE); char buf[64]; switch (prop) { - case ZFS_PROP_RESERVATION: - case ZFS_PROP_REFRESERVATION: - if (intval > volsize) { - zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, - "'%s' is greater than current " - "volume size"), propname); - (void) zfs_error(hdl, EZFS_BADPROP, - errbuf); - goto error; - } - break; - case ZFS_PROP_VOLSIZE: if (intval % blocksize != 0) { zfs_nicebytes(blocksize, buf, -- cgit v1.2.3