[LTP] [PATCH v4 1/6] syscalls/quotactl08: Test quoatctl01 but quota info hidden in filesystem

xuyang2018.jy@fujitsu.com xuyang2018.jy@fujitsu.com
Mon Jan 10 07:37:43 CET 2022


Hi Cyril
> Hi!
>> +static void verify_quota(unsigned int n)
>> +{
>> +	struct tcase *tc =&tcases[n];
>> +
>> +	res_dq.dqb_bsoftlimit = 0;
>> +	res_qf.dqi_igrace = 0;
>> +	fmt_buf = 0;
>> +	res_ndq.dqb_id = -1;
>> +
>> +	tst_res(TINFO, "Test #%d: %s", n, tc->tname);
>> +	if ((tc->cmd == QCMD(Q_GETNEXTQUOTA, USRQUOTA) ||
>> +		tc->cmd == QCMD(Q_GETNEXTQUOTA, GRPQUOTA))&&
>> +		getnextquota_nsup) {
>> +		tst_res(TCONF, "current system doesn't support this cmd");
>                                                                  ^
> 								Can we
> 								print
> 								tc->des
> 								here?
Yes.
>> +		return;
>> +	}
>> +	TEST(do_quotactl(fd, tc->cmd, tst_device->dev, *tc->id, tc->addr));
>> +	if (TST_RET == -1) {
>> +		tst_res(TFAIL | TTERRNO, "quotactl failed to %s", tc->des);
>> +		return;
>> +	}
>
> And this can be TST_EXP_PASS_SILENT() followed by if (!TST_PASS) return;
>
> The difference is that the TST_EXP* macros are more comprehensive if
> there is a bug in kernel that makes quotaclt() return a possitive number
> on success this test would still succeed while the macro will fail it.
Yes. But it seems all quotactl cases have this problem(ie quotactl01.c), 
so I plan to merge this first. Then make use of TST_EXP* macro for all 
quotactl cases in a separate patch.

What do you think about this?

Best Regards
Yang Xu
>
>
> Other than these two minor issues:
>
> Reviewed-by: Cyril Hrubis<chrubis@suse.cz>
>


More information about the ltp mailing list