Project

General

Profile

Bug #1884

Empty "used" field for zfs *space commands

Added by Alexander Eremin almost 8 years ago. Updated about 7 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
zfs - Zettabyte File System
Start date:
2011-12-14
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:

Description

~# zfs set userquota@alex=10M rpool/qqq
~# zfs get userquota@alex rpool/qqq
NAME       PROPERTY        VALUE           SOURCE
rpool/qqq  userquota@alex  10M             local
~# zfs userspace rpool/qqq
TYPE        NAME   USED  QUOTA
POSIX User  alex    10M
POSIX User  root  4.50K   none

Same for "zfs groupspace" command

History

#1

Updated by sham pavman almost 8 years ago

  • Assignee set to sham pavman
#2

Updated by sham pavman almost 8 years ago

After looking at the concerned code and a few snips from the manpage.. I believe this is the expected behavior
Here is the report...
"zfs get userquota .." is made to query only the requested value (in this case the assigned userquota for that user) and that's how you get the value as specified..

If you want to take a look at the actual consumption of space there is another property that you should query(userused or userspace) which will give you the desired output you're looking for.

Eg::

light@openindiana:~$ zpool list
NAME       SIZE  ALLOC   FREE    CAP  DEDUP  HEALTH  ALTROOT
rpool     39.8G  18.9G  20.8G    47%  1.00x  ONLINE  -
testpool  95.5M   141K  95.4M     0%  1.00x  ONLINE  -                             <----- (100M pool)

light@openindiana:~$ sudo zfs set userquota@root=50m testpool/data
light@openindiana:~$ sudo zfs get userquota@root testpool/data
NAME           PROPERTY        VALUE           SOURCE
testpool/data  userquota@root  50M             local

light@openindiana:~$ sudo mkfile 30m /testpool/data/newfile
light@openindiana:~$ sudo zfs get userused@root testpool/data
NAME           PROPERTY       VALUE          SOURCE
testpool/data  userused@root  30.0M          local

light@openindiana:~$ sudo zfs get userquota@root testpool/data
NAME           PROPERTY        VALUE           SOURCE
testpool/data  userquota@root  50M             local

light@openindiana:~$ sudo zfs userspace testpool/data
TYPE        NAME   USED  QUOTA
POSIX User  root  30.0M    50M

And here is a snippet from zfs man page stating that you need the userspace property to get the "used" field.

     userquota@user=size | none

         Limits the amount of space  consumed  by  the  specified
         user.  User  space  consumption  is  identified  by  the
         userspace@user property.

#3

Updated by Yuri Pankov about 7 years ago

sham pavman wrote:

After looking at the concerned code and a few snips from the manpage.. I believe this is the expected behavior
Here is the report...
"zfs get userquota .." is made to query only the requested value (in this case the assigned userquota for that user) and that's how you get the value as specified..

Still, there's a column named USED in the output, and it should report correct data.

If you want to take a look at the actual consumption of space there is another property that you should query(userused or userspace) which will give you the desired output you're looking for.

Eg::
[...]

And here is a snippet from zfs man page stating that you need the userspace property to get the "used" field.
[...]

#4

Updated by Igor Pashev about 7 years ago

Yuri Pankov wrote:

there's a column named USED in the output, and it should report correct data.

Do you mean it should be

~# zfs userspace rpool/qqq
TYPE        NAME   USED  QUOTA
POSIX User  alex  <some>  10M
POSIX User  root  4.50K   none

instead of:

~# zfs userspace rpool/qqq
TYPE        NAME   USED  QUOTA
POSIX User  alex    10M
POSIX User  root  4.50K   none

#5

Updated by Yuri Pankov about 7 years ago

Igor Pashev wrote:

Yuri Pankov wrote:

there's a column named USED in the output, and it should report correct data.

Do you mean it should be

[...]

instead of:
[...]

Exactly.

sirius:root:~# ~/ws/zfs-ugspace/usr/src/cmd/zfs/zfs userspace ustest
TYPE        NAME      USED  QUOTA
POSIX User  nobody       0    10G
POSIX User  root        3K   none
POSIX User  webservd     0    50G
POSIX User  yuri         0    10G

#6

Updated by Yuri Pankov about 7 years ago

  • Assignee changed from sham pavman to Yuri Pankov
#7

Updated by Rich Lowe about 7 years ago

  • Category set to zfs - Zettabyte File System
  • Status changed from New to Resolved
  • % Done changed from 0 to 100
  • Tags deleted (needs-triage)

Resolved in r13803 commit:b5e49d71ff0e

Also available in: Atom PDF