[LTP] [PATCH 1/2] Add FS quota availability check functions

Petr Vorel pvorel@suse.cz
Fri Mar 12 11:28:41 CET 2021


Hi Martin,

> +int tst_check_quota_support(const char *device, int format,
> +	const char *quotafile)
> +{
> +	TEST(quotactl(QCMD(Q_QUOTAON, USRQUOTA), device, format, quotafile));
Actually, there is a warning:
tst_supported_fs_types.c: In function ‘tst_check_quota_support’:
tst_supported_fs_types.c:117:59: warning: passing argument 4 of ‘quotactl’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  117 |  TEST(quotactl(QCMD(Q_QUOTAON, USRQUOTA), device, format, quotafile));

Would you prefer to cast to char *, or just change function parameter to char *?

Kind regards,
Petr

> +
> +	/* Not supported */
> +	if (TST_RET == -1 && TST_ERR == ESRCH)
> +		return 0;
> +
> +	/* Broken */
> +	if (TST_RET)
> +		return -1;
> +
> +	quotactl(QCMD(Q_QUOTAOFF, USRQUOTA), device, 0, 0);
> +	return 1;
> +}


More information about the ltp mailing list