Project

General

Profile

Bug #3739

cannot set zfs quota or reservation on pool version < 22

Added by Martin Matuška over 7 years ago. Updated over 7 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
zfs - Zettabyte File System
Start date:
2013-04-21
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

Starting with revision 13973:4972ab336f54 (3464 zfs synctask code needs restructuring) the process of setting quota and reservation has changed. The values are now set in dsl_dir.c using dsl_prop_set_sync_impl() instead of dsl_prop_set_sync() and the resulting value (newval) is determined with dsl_prop_get_int_ds().

The function dsl_prop_set_sync_impl() does the following:

    if (version < SPA_VERSION_RECVD_PROPS) {
        zfs_prop_t prop = zfs_name_to_prop(propname);
        if (prop == ZFS_PROP_QUOTA || prop == ZFS_PROP_RESERVATION)
            return;

This causes newval to be zero and quota and reservation are not being set on pools lower than version 22. Before 13973 setting quota and reservation was not dependent on dsl_prop_set_sync_impl().

I suggest removing the check (see attached patch).

Steps to reproduce:

zpool create -o version=21 testpool /some/device_or_file
zfs set quota=200M testpool
zfs get quota testpool
zfs set reservation=200M testpool
zfs get reservation testpool


Files

dsl_prop.c.patch (545 Bytes) dsl_prop.c.patch Martin Matuška, 2013-04-21 08:16 PM
dsl_prop.c.2.patch (2.68 KB) dsl_prop.c.2.patch Martin Matuška, 2013-04-22 06:56 PM
3739.patch (2.5 KB) 3739.patch Martin Matuška, 2013-04-22 10:39 PM

Also available in: Atom PDF