* no quota output if no usage?
@ 2014-11-26 19:26 Eric Sandeen
2014-11-26 21:21 ` Dave Chinner
0 siblings, 1 reply; 7+ messages in thread
From: Eric Sandeen @ 2014-11-26 19:26 UTC (permalink / raw)
To: xfs-oss
This seems a bit weird:
# xfs_quota -x -c 'quota -p project1' /mnt/test
#
Huh, did it work?
# xfs_quota -x -c 'quota -pv project1' /mnt/test
Disk quotas for Project project1 (1)
Filesystem Blocks Quota Limit Warn/Time Mounted on
/dev/sdc2 0 1024000 1228800 00 [--------] /mnt/test
#
Oh, ok!
I don't know why reporting limits should depend on the verbose flag, but it
has been that way since 2005 in quota_mount() :
if (!(flags & VERBOSE_FLAG)) {
count = 0;
if ((form & XFS_BLOCK_QUOTA) && d.d_bcount)
count++;
if ((form & XFS_INODE_QUOTA) && d.d_icount)
count++;
if ((form & XFS_RTBLOCK_QUOTA) && d.d_rtbcount)
count++;
if (!count)
return 0;
}
I'm inclined to change it, but is it OK to change the output of this - might old
scripts be relying on this (odd) silent behavior? I think it can certainly cause
confusion (as evidenced by at least one bug I'm looking at ...)
Thanks,
-Eric
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: no quota output if no usage?
2014-11-26 19:26 no quota output if no usage? Eric Sandeen
@ 2014-11-26 21:21 ` Dave Chinner
2014-11-26 21:26 ` Eric Sandeen
0 siblings, 1 reply; 7+ messages in thread
From: Dave Chinner @ 2014-11-26 21:21 UTC (permalink / raw)
To: Eric Sandeen; +Cc: xfs-oss
On Wed, Nov 26, 2014 at 01:26:55PM -0600, Eric Sandeen wrote:
> This seems a bit weird:
>
> # xfs_quota -x -c 'quota -p project1' /mnt/test
> #
>
> Huh, did it work?
>
> # xfs_quota -x -c 'quota -pv project1' /mnt/test
> Disk quotas for Project project1 (1)
> Filesystem Blocks Quota Limit Warn/Time Mounted on
> /dev/sdc2 0 1024000 1228800 00 [--------] /mnt/test
> #
>
> Oh, ok!
>
> I don't know why reporting limits should depend on the verbose flag, but it
> has been that way since 2005 in quota_mount() :
>
> if (!(flags & VERBOSE_FLAG)) {
> count = 0;
> if ((form & XFS_BLOCK_QUOTA) && d.d_bcount)
> count++;
> if ((form & XFS_INODE_QUOTA) && d.d_icount)
> count++;
> if ((form & XFS_RTBLOCK_QUOTA) && d.d_rtbcount)
> count++;
> if (!count)
> return 0;
> }
>
> I'm inclined to change it, but is it OK to change the output of this - might old
> scripts be relying on this (odd) silent behavior? I think it can certainly cause
> confusion (as evidenced by at least one bug I'm looking at ...)
It's done that way because the quota lookup can find dquots that are
completely empty because there are no uid/gid/prid found in the
filesystem, but the dquot is allocated because it's within a block
that has in use dquots in it. I'd guess that if you queried a
non-existent project quota (e.g. prid 2) you'd get the same
result....
i.e. you've got to have inodes or blocks accounted to have a dquot
"created" for the uid/gid/prid in normal conditions, hence dquots
with zero counts are ignored by default as they are effectively
the same as unallocated dquots....
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: no quota output if no usage?
2014-11-26 21:21 ` Dave Chinner
@ 2014-11-26 21:26 ` Eric Sandeen
2014-11-26 22:18 ` Dave Chinner
0 siblings, 1 reply; 7+ messages in thread
From: Eric Sandeen @ 2014-11-26 21:26 UTC (permalink / raw)
To: Dave Chinner; +Cc: xfs-oss
On 11/26/14 3:21 PM, Dave Chinner wrote:
> On Wed, Nov 26, 2014 at 01:26:55PM -0600, Eric Sandeen wrote:
>> This seems a bit weird:
>>
>> # xfs_quota -x -c 'quota -p project1' /mnt/test
>> #
>>
>> Huh, did it work?
>>
>> # xfs_quota -x -c 'quota -pv project1' /mnt/test
>> Disk quotas for Project project1 (1)
>> Filesystem Blocks Quota Limit Warn/Time Mounted on
>> /dev/sdc2 0 1024000 1228800 00 [--------] /mnt/test
>> #
>>
>> Oh, ok!
>>
>> I don't know why reporting limits should depend on the verbose flag, but it
>> has been that way since 2005 in quota_mount() :
>>
>> if (!(flags & VERBOSE_FLAG)) {
>> count = 0;
>> if ((form & XFS_BLOCK_QUOTA) && d.d_bcount)
>> count++;
>> if ((form & XFS_INODE_QUOTA) && d.d_icount)
>> count++;
>> if ((form & XFS_RTBLOCK_QUOTA) && d.d_rtbcount)
>> count++;
>> if (!count)
>> return 0;
>> }
>>
>> I'm inclined to change it, but is it OK to change the output of this - might old
>> scripts be relying on this (odd) silent behavior? I think it can certainly cause
>> confusion (as evidenced by at least one bug I'm looking at ...)
>
> It's done that way because the quota lookup can find dquots that are
> completely empty because there are no uid/gid/prid found in the
> filesystem, but the dquot is allocated because it's within a block
> that has in use dquots in it. I'd guess that if you queried a
> non-existent project quota (e.g. prid 2) you'd get the same
> result....
if I ask for something that doesn't exist by name, it tells me:
# xfs_quota -x -c 'quota -pv project4' /mnt/test
xfs_quota: cannot find project project4
or if I ask by prid, I get nothing with or without -v :(
# xfs_quota -x -c 'quota -pv 4' /mnt/test
#
> i.e. you've got to have inodes or blocks accounted to have a dquot
> "created" for the uid/gid/prid in normal conditions, hence dquots
> with zero counts are ignored by default as they are effectively
> the same as unallocated dquots....
That's all well and good, but with -v it is able to tell me what
the set limits are, and that I have no blocks allocated within those limits.
So the information we might expect seems available; it's just not
shown, because the code short-circuits it w/o -v.
Or am I missing something ...
-Eric
> Cheers,
>
> Dave.
>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: no quota output if no usage?
2014-11-26 21:26 ` Eric Sandeen
@ 2014-11-26 22:18 ` Dave Chinner
2014-11-27 0:28 ` Eric Sandeen
0 siblings, 1 reply; 7+ messages in thread
From: Dave Chinner @ 2014-11-26 22:18 UTC (permalink / raw)
To: Eric Sandeen; +Cc: xfs-oss
On Wed, Nov 26, 2014 at 03:26:26PM -0600, Eric Sandeen wrote:
> On 11/26/14 3:21 PM, Dave Chinner wrote:
> > On Wed, Nov 26, 2014 at 01:26:55PM -0600, Eric Sandeen wrote:
> >> This seems a bit weird:
> >>
> >> # xfs_quota -x -c 'quota -p project1' /mnt/test
> >> #
> >>
> >> Huh, did it work?
> >>
> >> # xfs_quota -x -c 'quota -pv project1' /mnt/test
> >> Disk quotas for Project project1 (1)
> >> Filesystem Blocks Quota Limit Warn/Time Mounted on
> >> /dev/sdc2 0 1024000 1228800 00 [--------] /mnt/test
> >> #
> >>
> >> Oh, ok!
> >>
> >> I don't know why reporting limits should depend on the verbose flag, but it
> >> has been that way since 2005 in quota_mount() :
> >>
> >> if (!(flags & VERBOSE_FLAG)) {
> >> count = 0;
> >> if ((form & XFS_BLOCK_QUOTA) && d.d_bcount)
> >> count++;
> >> if ((form & XFS_INODE_QUOTA) && d.d_icount)
> >> count++;
> >> if ((form & XFS_RTBLOCK_QUOTA) && d.d_rtbcount)
> >> count++;
> >> if (!count)
> >> return 0;
> >> }
> >>
> >> I'm inclined to change it, but is it OK to change the output of this - might old
> >> scripts be relying on this (odd) silent behavior? I think it can certainly cause
> >> confusion (as evidenced by at least one bug I'm looking at ...)
> >
> > It's done that way because the quota lookup can find dquots that are
> > completely empty because there are no uid/gid/prid found in the
> > filesystem, but the dquot is allocated because it's within a block
> > that has in use dquots in it. I'd guess that if you queried a
> > non-existent project quota (e.g. prid 2) you'd get the same
> > result....
>
> if I ask for something that doesn't exist by name, it tells me:
>
> # xfs_quota -x -c 'quota -pv project4' /mnt/test
> xfs_quota: cannot find project project4
It can't convert it to a prid because it's not in the /etc/projects
file. Project quotas are a little bit special in this way.
> or if I ask by prid, I get nothing with or without -v :(
>
> # xfs_quota -x -c 'quota -pv 4' /mnt/test
> #
Ah, I missed the XFS_IS_DQUOT_UNINITIALIZED() check at the syscall
entry point. It checks for everything being zero and returns -ENOENT
if it's an empty dquot. Too many bloody layers of validation....
> > i.e. you've got to have inodes or blocks accounted to have a dquot
> > "created" for the uid/gid/prid in normal conditions, hence dquots
> > with zero counts are ignored by default as they are effectively
> > the same as unallocated dquots....
>
> That's all well and good, but with -v it is able to tell me what
> the set limits are, and that I have no blocks allocated within those limits.
>
> So the information we might expect seems available; it's just not
> shown, because the code short-circuits it w/o -v.
>
> Or am I missing something ...
Nope, I'm confusing different reporting command behaviour....
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: no quota output if no usage?
2014-11-26 22:18 ` Dave Chinner
@ 2014-11-27 0:28 ` Eric Sandeen
2014-11-27 9:32 ` Jan Kara
0 siblings, 1 reply; 7+ messages in thread
From: Eric Sandeen @ 2014-11-27 0:28 UTC (permalink / raw)
To: Dave Chinner; +Cc: xfs-oss
On 11/26/14 4:18 PM, Dave Chinner wrote:
>> Or am I missing something ...
>
> Nope, I'm confusing different reporting command behaviour....
Ok, so back to the original question: think it's cool to drop
the verbose requirement to find out limits when there is 0 usage?
-Eric
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: no quota output if no usage?
2014-11-27 0:28 ` Eric Sandeen
@ 2014-11-27 9:32 ` Jan Kara
2014-11-28 16:40 ` Eric Sandeen
0 siblings, 1 reply; 7+ messages in thread
From: Jan Kara @ 2014-11-27 9:32 UTC (permalink / raw)
To: Eric Sandeen; +Cc: xfs-oss
On Wed 26-11-14 18:28:32, Eric Sandeen wrote:
> On 11/26/14 4:18 PM, Dave Chinner wrote:
>
> >> Or am I missing something ...
> >
> > Nope, I'm confusing different reporting command behaviour....
>
> Ok, so back to the original question: think it's cool to drop
> the verbose requirement to find out limits when there is 0 usage?
Just as a data point quota(1) command from quota-tools also doesn't
report quota entries where no space & inode is accounted without -v option.
I never thought it's particularly useful but apparently it's some heritage
from the original implementation of quota in some Unix and so I decided to
maintain compatibility...
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: no quota output if no usage?
2014-11-27 9:32 ` Jan Kara
@ 2014-11-28 16:40 ` Eric Sandeen
0 siblings, 0 replies; 7+ messages in thread
From: Eric Sandeen @ 2014-11-28 16:40 UTC (permalink / raw)
To: Jan Kara; +Cc: xfs-oss
On 11/27/14 3:32 AM, Jan Kara wrote:
> On Wed 26-11-14 18:28:32, Eric Sandeen wrote:
>> On 11/26/14 4:18 PM, Dave Chinner wrote:
>>
>>>> Or am I missing something ...
>>>
>>> Nope, I'm confusing different reporting command behaviour....
>>
>> Ok, so back to the original question: think it's cool to drop
>> the verbose requirement to find out limits when there is 0 usage?
> Just as a data point quota(1) command from quota-tools also doesn't
> report quota entries where no space & inode is accounted without -v option.
> I never thought it's particularly useful but apparently it's some heritage
> from the original implementation of quota in some Unix and so I decided to
> maintain compatibility...
Thanks - sounds like maybe the weight of history is behind this. Perhaps
it'll just be a documentation fix to clarify what happens when there's no
block or inode used.
-Eric
> Honza
>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2014-11-28 16:40 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-26 19:26 no quota output if no usage? Eric Sandeen
2014-11-26 21:21 ` Dave Chinner
2014-11-26 21:26 ` Eric Sandeen
2014-11-26 22:18 ` Dave Chinner
2014-11-27 0:28 ` Eric Sandeen
2014-11-27 9:32 ` Jan Kara
2014-11-28 16:40 ` Eric Sandeen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox