Print this page
OS-1566 filesystem limits for ZFS datasets

@@ -475,11 +475,11 @@
 
         error = zfs_dozonecheck_ds(name, ds, cr);
         if (error == 0) {
                 error = secpolicy_zfs(cr);
                 if (error)
-                        error = dsl_deleg_access_impl(ds, perm, cr);
+                        error = dsl_deleg_access_impl(ds, perm, cr, B_TRUE);
         }
 
         dsl_dataset_rele(ds, FTAG);
         return (error);
 }

@@ -492,11 +492,11 @@
 
         error = zfs_dozonecheck_ds(name, ds, cr);
         if (error == 0) {
                 error = secpolicy_zfs(cr);
                 if (error)
-                        error = dsl_deleg_access_impl(ds, perm, cr);
+                        error = dsl_deleg_access_impl(ds, perm, cr, B_TRUE);
         }
         return (error);
 }
 
 /*

@@ -614,16 +614,18 @@
                 if (!INGLOBALZONE(curproc))
                         return (EPERM);
                 break;
 
         case ZFS_PROP_QUOTA:
+        case ZFS_PROP_FILESYSTEM_LIMIT:
+        case ZFS_PROP_SNAPSHOT_LIMIT:
                 if (!INGLOBALZONE(curproc)) {
                         uint64_t zoned;
                         char setpoint[MAXNAMELEN];
                         /*
                          * Unprivileged users are allowed to modify the
-                         * quota on things *under* (ie. contained by)
+                         * limit on things *under* (ie. contained by)
                          * the thing they own.
                          */
                         if (dsl_prop_get_integer(dsname, "zoned", &zoned,
                             setpoint))
                                 return (EPERM);

@@ -2381,10 +2383,18 @@
                 err = dsl_dir_set_quota(dsname, source, intval);
                 break;
         case ZFS_PROP_REFQUOTA:
                 err = dsl_dataset_set_quota(dsname, source, intval);
                 break;
+        case ZFS_PROP_FILESYSTEM_LIMIT:
+                err = dsl_dir_validate_fs_ss_limit(dsname, intval,
+                    ZFS_PROP_FILESYSTEM_LIMIT);
+                break;
+        case ZFS_PROP_SNAPSHOT_LIMIT:
+                err = dsl_dir_validate_fs_ss_limit(dsname, intval,
+                    ZFS_PROP_SNAPSHOT_LIMIT);
+                break;
         case ZFS_PROP_RESERVATION:
                 err = dsl_dir_set_reservation(dsname, source, intval);
                 break;
         case ZFS_PROP_REFRESERVATION:
                 err = dsl_dataset_set_reservation(dsname, source, intval);