Print this page
OS-1566 filesystem limits for ZFS datasets

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libzfs/common/libzfs_util.c
          +++ new/usr/src/lib/libzfs/common/libzfs_util.c
↓ open down ↓ 1257 lines elided ↑ open up ↑
1258 1258  
1259 1259                  /*
1260 1260                   * Quota special: force 'none' and don't allow 0.
1261 1261                   */
1262 1262                  if ((type & ZFS_TYPE_DATASET) && *ivalp == 0 && !isnone &&
1263 1263                      (prop == ZFS_PROP_QUOTA || prop == ZFS_PROP_REFQUOTA)) {
1264 1264                          zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
1265 1265                              "use 'none' to disable quota/refquota"));
1266 1266                          goto error;
1267 1267                  }
     1268 +
     1269 +                /*
     1270 +                 * Special handling for "*_limit=none". In this case it's not
     1271 +                 * 0 but UINT64_MAX.
     1272 +                 */
     1273 +                if ((type & ZFS_TYPE_DATASET) && isnone &&
     1274 +                    (prop == ZFS_PROP_FILESYSTEM_LIMIT ||
     1275 +                    prop == ZFS_PROP_SNAPSHOT_LIMIT)) {
     1276 +                        *ivalp = UINT64_MAX;
     1277 +                }
1268 1278                  break;
1269 1279  
1270 1280          case PROP_TYPE_INDEX:
1271 1281                  if (datatype != DATA_TYPE_STRING) {
1272 1282                          zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
1273 1283                              "'%s' must be a string"), nvpair_name(elem));
1274 1284                          goto error;
1275 1285                  }
1276 1286  
1277 1287                  (void) nvpair_value_string(elem, &value);
↓ open down ↓ 255 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX