zfs snapshot_limit is not respected

From: Ultima <ultima1252_at_gmail.com>
Date: Thu, 2 Feb 2017 21:31:58 -0500
I recently moved some data on a box with limited space. I decided I should
limit the snapshots so that space would not become an issue. I just check
back a week later to find out the box is hitting the borderline. Doing I
quick check I realized that the snapshot_limit is not being respected.

# uname -a
FreeBSD R1 11.0-STABLE FreeBSD 11.0-STABLE #17 r312232: Sun Jan 15 10:59:10
EST 2017     root_at_S1:/usr/src/11-STABLE/obj/usr/src/11-STABLE/src/sys/MYKERNEL
 amd64

# zfs create zroot/bhyve/test
# zfs set snapshot_limit=0 zroot/bhyve/test
# zfs snapshot zroot/bhyve/test_at_1


# zfs snapshot zroot/bhyve/test_at_2
# zfs snapshot zroot/bhyve/test_at_3
# zfs list -t snapshot | grep zroot/bhyve/test
zroot/bhyve/test_at_1                                           0      -
 88K  -
zroot/bhyve/test_at_2                                           0      -
 88K  -
zroot/bhyve/test_at_3                                           0      -
 88K  -
# zfs get all zroot/bhyve/test | grep snapshot
zroot/bhyve/test  usedbysnapshots       0                      -
zroot/bhyve/test  snapshot_limit        0                      local
zroot/bhyve/test  snapshot_count        3                      local

Also wanted to verify 0 was not being mistaken for none.

# for snapshot in `zfs list -t snapshot | grep zroot/bhyve/test | awk
'{print $1}'`; do zfs destroy $snapshot ; done

# zfs get all zroot/bhyve/test | grep snapshot
zroot/bhyve/test  usedbysnapshots       0                      -
zroot/bhyve/test  snapshot_limit        0                      local
zroot/bhyve/test  snapshot_count        0                      local

# zfs set snapshot_limit=1 zroot/bhyve/test
# zfs snapshot zroot/bhyve/test_at_1
# zfs snapshot zroot/bhyve/test_at_2
# zfs snapshot zroot/bhyve/test_at_3
# zfs get all zroot/bhyve/test | grep snapshot
zroot/bhyve/test  usedbysnapshots       0                      -
zroot/bhyve/test  snapshot_limit        1                      local
zroot/bhyve/test  snapshot_count        3                      local


Also tested on head
FreeBSD S1 12.0-CURRENT FreeBSD 12.0-CURRENT #26 r312388: Wed Jan 18
12:38:52 EST 2017
root_at_S1:/usr/src/head/obj/usr/src/head/src/sys/MYKERNEL-NODEBUG
 amd64
Received on Fri Feb 03 2017 - 01:31:59 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:10 UTC