zfs/lib
Todd Seidelmann 03006174b7 Implement default user and group quotas
This change adds the 'defaultuserquota' and 'defaultgroupquota'
properties to ZFS datasets to apply a quota to users and groups that do
not have a specific quota assigned. The default quota checking
mechanism works alongside the existing 'userquota' and 'groupquota'
checks, only taking effect if no quota is assigned for a particular
user/group. This means that it's possible to exceed a default quota
by quite a lot before the user/groupused property is updated and
further writes are denied, which was already the case for
user/groupquota.

Default quotas are implemented similarly to 'normal' user quotas,
but instead of being user properties that are preserved across
snapshots, they default back to none. NB: this is different from the
observed Solaris behavior, which is to preserve default quotas across
snapshot/clone/promote.

For instance, Solaris has:
    # zfs set defaultuserquota=100M tank/fs
    # zfs snap tank/fs@snap
    # zfs clone tank/fs@snap tank/fs-clone
    # zfs get -H defaultuserquota tank/fs-clone
    tank/fs-clone   defaultuserquota        100M    -

Whereas this commit does:
    # zfs set defaultuserquota=100M tank/fs
    # zfs snap tank/fs@snap
    # zfs clone tank/fs@snap tank/fs-clone
    # zfs get -H defaultuserquota tank/fs-clone
    tank/fs-clone	defaultuserquota	none	default

It should also be possible to implement a default project quota using
an analogous process, if doing so makes sense.

Signed-off-by: Todd Seidelmann <seidelma@wharton.upenn.edu>
2024-08-02 17:14:42 -04:00
..
libavl cppcheck: explicitly exclude kernel code from userspace checks 2022-05-10 10:20:55 -07:00
libefi Replace P2ALIGN with P2ALIGN_TYPED and delete P2ALIGN. 2024-05-10 08:47:21 -07:00
libicp icp: remove skein module 2024-05-31 15:13:39 -07:00
libnvpair libspl: lift backtrace into a separate file 2024-05-14 09:48:45 -07:00
libshare Add support for multiple lines to the sharenfs property for FreeBSD (#16338) 2024-07-23 16:38:19 -07:00
libspl spl: fix compilation without HAVE_BACKTRACE 2024-05-29 10:51:01 -07:00
libtpool tpool_dispatch: fail if it cannot start at least 1 worker. 2024-05-14 09:35:48 -07:00
libunicode cppcheck: explicitly exclude kernel code from userspace checks 2022-05-10 10:20:55 -07:00
libuutil libspl: lift backtrace into a separate file 2024-05-14 09:48:45 -07:00
libzdb Provide macros for setting and getting blkptr birth times 2024-03-25 15:01:54 -07:00
libzfs Implement default user and group quotas 2024-08-02 17:14:42 -04:00
libzfs_core ddt: add support for prefetching tables into the ARC 2024-07-26 09:16:18 -07:00
libzfsbootenv nvpair: Constify string functions 2023-03-14 15:25:50 -07:00
libzpool libzpool: set thread names 2024-05-01 10:51:44 -07:00
libzstd cppcheck: explicitly exclude kernel code from userspace checks 2022-05-10 10:20:55 -07:00
libzutil libzfs: use zfs_strerror() in place of strerror() 2024-01-29 09:54:57 -08:00
Makefile.am libzdb: Initial breakout of libzdb 2024-02-05 10:00:41 -08:00