[LTP] [PATCH v2 3/6] syscalls/quotactl01.c: Add Q_GETNEXQUOTA test

Yang Xu xuyang2018.jy@cn.fujitsu.com
Fri Nov 1 13:44:45 CET 2019


on 2019/10/31 22:31, Petr Vorel wrote:

> Hi Xu,
>
>> Q_GETNEXTQUOTA was introduced since linux 4.6, this operation is the
>> same as Q_GETQUOTA, but it returns quota information for the next ID
>> greater than or equal to id that has a quota set.
>> Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
>> ---
>>   include/lapi/quotactl.h                       | 23 ++---
>>   m4/ltp-quota.m4                               | 36 +-------
>>   .../kernel/syscalls/quotactl/quotactl01.c     | 86 ++++++++++++-------
>>   3 files changed, 67 insertions(+), 78 deletions(-)
>> diff --git a/include/lapi/quotactl.h b/include/lapi/quotactl.h
> ...
>>   #ifndef LAPI_QUOTACTL_H__
>>   # define LAPI_QUOTACTL_H__
>> +#include <linux/quota.h>
> I'd prefer to add autotools check for <linux/quota.h configure.ac
> (I guess we ignore include/config.h.default atm).
>
> But, more important, I'd prefer to include <sys/quota.h> here as well:
>
> #ifdef HAVE_LINUX_QUOTA_H
> # include <linux/quota.h>
> #else
> # include <sys/quota.h>
> #endif

Hi Petr

It still has problems that sys/quota.h has some struct defintion as struct dqblk ,struct dqinfo.
Also, now linux/quota.h doesn't have quotactl function declaration.

I think we can use HAVE_STRUCT_IF_NEXTDQBLK macro in lapi/quotactl.h to decide whether include <linux/quota.h> because
I add <linux/quota.h> for finding struct if_netxdqblk defintion.

  

ps: In my ltp fork, it passed.

[1]https://travis-ci.org/xuyang0410/ltp/builds/605963472?utm_medium=notification&utm_source=github_status

Thanks
Yang Xu

>
> => move it from quotactl0*.c (there is not yet agreement to include headers in
> lapi files, but later lapi files does it).
>
> The reason is that old distros fail when both headers are included at the same
> time (probably <linux/quota.h> got fixed later, maybe there is an workaround,
> but the easiest way is to handle this in header anyway).
>
> Kind regards,
> Petr
>
> [1] https://travis-ci.org/pevik/ltp/jobs/605507690
> [2] https://api.travis-ci.org/v3/job/605507690/log.txt
>
>


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20191101/06f679de/attachment.htm>


More information about the ltp mailing list