Bug 172197 - [zfs] Userquota (as well as groupquota) does not work on ZFS (possible regression)
Summary: [zfs] Userquota (as well as groupquota) does not work on ZFS (possible regres...
Status: Closed Overcome By Events
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: Bugmeister
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-01 04:00 UTC by takeda
Modified: 2025-01-19 06:31 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description takeda 2012-10-01 04:00:21 UTC
I actually just started uzing ZFS since version 9 and seeing some communication on mailing lists, looks like this behavior is incorrect.

Here's an example:

[chinatsu]:/root# zfs userspace tank
TYPE        NAME  USED  QUOTA
POSIX User  root    6K  none
[chinatsu]:/root# zfs set userquota@takeda=5M tank
[chinatsu]:/root# zfs userspace tank
TYPE        NAME    USED  QUOTA
POSIX User  root      6K  none
POSIX User  takeda    5M

Please note that the above command updated USED value and not quota. As I show later the USED value is not updated based on storage usage and the quota is not enforced at all. I don't think it is necessary, but I also compiled the kernel with "options QUOTA".

[chinatsu]:/root# zfs set userquota@takeda=100M tank
[chinatsu]:/root# zfs userspace tank
TYPE        NAME    USED  QUOTA
POSIX User  root      6K  none
POSIX User  takeda  100M
[chinatsu]:/root# zfs set userquota@takeda=1000P tank
[chinatsu]:/root# zfs userspace tank
TYPE        NAME    USED  QUOTA
POSIX User  root      6K  none
POSIX User  takeda  1000P
[chinatsu]:/root# zfs set userquota@takeda=1M tank
[chinatsu]:/root# su - takeda
➜  ~  dd if=/dev/urandom bs=512k count=10 of=testfile1
10+0 records in
10+0 records out
5242880 bytes transferred in 0.433006 secs (12108105 bytes/sec)
➜  ~  dd if=/dev/urandom bs=512k count=10 of=testfile2
10+0 records in
10+0 records out
5242880 bytes transferred in 0.072985 secs (71835100 bytes/sec)
➜  ~  ls -lh testfile*
-rw-r--r--  1 takeda  users   5,0M 30 wrz 19:50 testfile1
-rw-r--r--  1 takeda  users   5,0M 30 wrz 19:50 testfile2
➜  ~
[chinatsu]:/root# zfs userspace tank
TYPE        NAME    USED  QUOTA
POSIX User  root      6K  none
POSIX User  takeda    1M

Fix: 

I know too little to recommend anything.
How-To-Repeat: Perform the steps described in description.
Comment 1 Yuri Pankov 2012-10-03 04:33:04 UTC
The zfs' userspace/groupspace commands are really broken in 9.0 (fixed 
upstream and in HEAD), don't rely on their output for the time being.
Comment 2 takeda 2012-10-03 06:06:18 UTC
Hello Yuri,

Tuesday, October 2, 2012, 8:33:04 PM, you wrote:

> The zfs' userspace/groupspace commands are really broken in 9.0 (fixed
> upstream and in HEAD), don't rely on their output for the time being.

Thanks, any idea whether that will also fix enforcing of the quota?

-- 
Best regards,
 Derek                            mailto:takeda@takeda.tk

I like kids, but I don't think I could eat a whole one.
Comment 3 Mark Linimon freebsd_committer freebsd_triage 2014-04-17 05:32:42 UTC
State Changed
From-To: open->feedback
Comment 4 Mark Linimon freebsd_committer freebsd_triage 2014-04-17 05:32:42 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-fs

to submitter: ZFS has been updated several times since this PR was filed. 
Is it still relevant?
Comment 5 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 08:01:22 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped
Comment 6 Mark Linimon freebsd_committer freebsd_triage 2025-01-19 06:31:38 UTC
^Triage: I'm sorry that this PR did not get addressed in a timely fashion.

By now, the version that it was created against is long out of support.
As well, many newer versions of ZFS have been imported.

Please re-open if it is still a problem on a supported version.