mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
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 <behlendorf1@llnl.gov> Reviewed-by: George Melikov <mail@gmelikov.ru> Reviewed by: Richard Elling <Richard.Elling@RichardElling.com> Reviewed by: Matthew Ahrens <mahrens@delphix.com> Signed-off-by: loli10K <ezomori.nozomu@gmail.com> Closes #2468 Closes #6610
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user