xfs
[Top] [All Lists]

Re: [PATCH] xfs_quota: wire up XFS_GETQSTATV

To: Zorro Lang <zlang@xxxxxxxxxx>
Subject: Re: [PATCH] xfs_quota: wire up XFS_GETQSTATV
From: Eric Sandeen <sandeen@xxxxxxxxxx>
Date: Mon, 15 Aug 2016 11:43:10 -0500
Cc: xfs-oss <xfs@xxxxxxxxxxx>
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <20160815163859.GA7193@xxxxxxxxxxxxxxxxxxxxxxxx>
References: <a8d81afb-8c95-c6bf-028d-8d6e463557b3@xxxxxxxxxx> <20160815163859.GA7193@xxxxxxxxxxxxxxxxxxxxxxxx>
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.2.0
On 8/15/16 11:38 AM, Zorro Lang wrote:
> From the result of strace, we can see:
>   quotactl(0x5808 /* Q_??? */|USRQUOTA, "/dev/mapper/testvg-scratchdev", 0, 
> 0x7ffdbbda94c0) = -1 EINVAL (Invalid argument)
>   quotactl(Q_XGETQSTAT|USRQUOTA, "/dev/mapper/testvg-scratchdev", 0, 
> {version=1, ...}) = 0
> 
> So the first call for XFS_GETQSTATV return EINVAL.
> 
> In linux kernel quota_getxstatev() function, the logic is:
>   /* If this kernel doesn't support user specified version, fail */
>   switch (fqs.qs_version) {
>   case FS_QSTATV_VERSION1:
>         break;
>   default:
>         return -EINVAL;
>   }
> 
> So we need to set qa_version to FS_QSTATV_VERSION1, before
> we call XFS_GETQSTATV. And as we talked on IRC, it test passed if I set
> 
>   sv.qs_version = 1;
> 
> at here.
> 
> So maybe a V2 patch is needed to fix this problem:)

Yep, kernel commit said:

| Callers of the new quotactl command have to set the version of the data
| structure being passed, and kernel will fill as much data as requested.
| If the kernel does not support the user-space provided version, EINVAL
| will be returned. User-space can reduce the version number and call the same
| quotactl again.

but this isn't documented anywhere else, AFAICT; this call still isn't
documented in the quotactl manpage.  o_O

I'll fix it up, thanks for catching it!

-Eric

<Prev in Thread] Current Thread [Next in Thread>