From nobody@FreeBSD.org  Mon Oct  1 02:59:10 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 50CAC1065672
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  1 Oct 2012 02:59:10 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 2364C8FC1D
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  1 Oct 2012 02:59:10 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.5/8.14.5) with ESMTP id q912x99q050108
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 1 Oct 2012 02:59:09 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.5/8.14.5/Submit) id q912x9vn050107;
	Mon, 1 Oct 2012 02:59:09 GMT
	(envelope-from nobody)
Message-Id: <201210010259.q912x9vn050107@red.freebsd.org>
Date: Mon, 1 Oct 2012 02:59:09 GMT
From: Derek Kulinski <takeda@takeda.tk>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Userquota (as well as groupquota) does not work on ZFS (possible regression)
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         172197
>Category:       kern
>Synopsis:       [zfs] Userquota (as well as groupquota) does not work on ZFS (possible regression)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-fs
>State:          feedback
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Oct 01 03:00:21 UTC 2012
>Closed-Date:    
>Last-Modified:  Thu Apr 17 04:33:50 UTC 2014
>Originator:     Derek Kulinski
>Release:        FreeBSD 9.0
>Organization:
>Environment:
FreeBSD chinatsu.takeda.tk 9.0-RELEASE-p4 FreeBSD 9.0-RELEASE-p4 #2: Sun Sep 30 17:10:32 PDT 2012     root@chinatsu.takeda.tk:/usr/obj/tank/junk/src/sys/CHINATSU  amd64

>Description:
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
&#10140;  ~  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)
&#10140;  ~  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)
&#10140;  ~  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
&#10140;  ~
[chinatsu]:/root# zfs userspace tank
TYPE        NAME    USED  QUOTA
POSIX User  root      6K  none
POSIX User  takeda    1M

>How-To-Repeat:
Perform the steps described in description.
>Fix:
I know too little to recommend anything.

>Release-Note:
>Audit-Trail:

From: Yuri Pankov <yuri.pankov@gmail.com>
To: Derek Kulinski <takeda@takeda.tk>, 
 freebsd-bug-followup <bug-followup@FreeBSD.org>
Cc:  
Subject: Re: kern/172197: Userquota (as well as groupquota) does not work
 on ZFS (possible regression)
Date: Wed, 03 Oct 2012 07:33:04 +0400

 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.

From: Derek Kulinski <takeda@takeda.tk>
To: Yuri Pankov <yuri.pankov@gmail.com>
Cc: freebsd-bug-followup <bug-followup@FreeBSD.org>
Subject: Re: kern/172197: Userquota (as well as groupquota) does not work on ZFS (possible regression)
Date: Tue, 2 Oct 2012 22:06:18 -0700

 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.
 
State-Changed-From-To: open->feedback 
State-Changed-By: linimon 
State-Changed-When: Thu Apr 17 04:32:42 UTC 2014 
State-Changed-Why:  
reclassify. 


Responsible-Changed-From-To: freebsd-bugs->freebsd-fs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Thu Apr 17 04:32:42 UTC 2014 
Responsible-Changed-Why:  
to submitter: ZFS has been updated several times since this PR was filed. 
Is it still relevant? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=172197 
>Unformatted:
