[LTP] [PATCH 2/3] quotactl06: Code style fixes

xuyang2018.jy@fujitsu.com xuyang2018.jy@fujitsu.com
Fri Mar 4 02:36:22 CET 2022


Hi Martin

Looks good to me,
Reviewed-by: Yang Xu <xuyang2018.jy@fujitsu.com>

Best Regards
Yang Xu
> Signed-off-by: Martin Doucha<mdoucha@suse.cz>
> ---
>   .../kernel/syscalls/quotactl/quotactl06.c     | 49 +++++++++++--------
>   1 file changed, 29 insertions(+), 20 deletions(-)
> 
> diff --git a/testcases/kernel/syscalls/quotactl/quotactl06.c b/testcases/kernel/syscalls/quotactl/quotactl06.c
> index ca81a742f..8e9a17393 100644
> --- a/testcases/kernel/syscalls/quotactl/quotactl06.c
> +++ b/testcases/kernel/syscalls/quotactl/quotactl06.c
> @@ -12,22 +12,23 @@
>    *
>    * - EACCES when cmd is Q_QUOTAON and addr existed but not a regular file
>    * - ENOENT when the file specified by special or addr does not exist
> - * - EBUSY when cmd is Q_QUOTAON and another Q_QUOTAON had already been performed
> + * - EBUSY when cmd is Q_QUOTAON and another Q_QUOTAON had already been
> + *   performed
>    * - EFAULT when addr or special is invalid
>    * - EINVAL when cmd or type is invalid
>    * - ENOTBLK when special is not a block device
> - * - ESRCH when no disk quota is found for the indicated user and quotas have not been
> - *   turned on for this fs
> + * - ESRCH when no disk quota is found for the indicated user and quotas have
> + *   not been turned on for this fs
>    * - ESRCH when cmd is Q_QUOTAON, but the quota format was not found
> - * - ESRCH when cmd is Q_GETNEXTQUOTA, but there is no ID greater than or equal to id that
> - *   has an active quota
> - * - ERANGE when cmd is Q_SETQUOTA, but the specified limits are out of the range allowed
> - *   by the quota format
> - * - EPERM when the caller lacked the required privilege (CAP_SYS_ADMIN) for the specified
> - *   operation
> + * - ESRCH when cmd is Q_GETNEXTQUOTA, but there is no ID greater than or
> + *   equal to id that has an active quota
> + * - ERANGE when cmd is Q_SETQUOTA, but the specified limits are out of the
> + *   range allowed by the quota format
> + * - EPERM when the caller lacked the required privilege (CAP_SYS_ADMIN) for
> + *   the specified operation
>    *
> - * For ERANGE error, the vfsv0 and vfsv1 format's maximum quota limit setting have been
> - * fixed since the following kernel patch:
> + * For ERANGE error, the vfsv0 and vfsv1 format's maximum quota limit setting
> + * have been fixed since the following kernel patch:
>    *
>    *  commit 7e08da50cf706151f324349f9235ebd311226997
>    *  Author: Jan Kara<jack@suse.cz>
> @@ -135,10 +136,13 @@ static void verify_quotactl(unsigned int n)
>   	}
> 
>   	if (tc->on_flag) {
> -		TST_EXP_PASS_SILENT(quotactl(QCMD(Q_QUOTAON, USRQUOTA), tst_device->dev,
> -					fmt_id, usrpath), "quotactl with Q_QUOTAON");
> +		TST_EXP_PASS_SILENT(quotactl(QCMD(Q_QUOTAON, USRQUOTA),
> +			tst_device->dev, fmt_id, usrpath),
> +			"quotactl with Q_QUOTAON");
> +
>   		if (!TST_PASS)
>   			return;
> +
>   		quota_on = 1;
>   	}
> 
> @@ -147,16 +151,19 @@ static void verify_quotactl(unsigned int n)
>   		drop_flag = 1;
>   	}
> 
> -	if (tc->exp_err == ENOTBLK)
> +	if (tc->exp_err == ENOTBLK) {
>   		TST_EXP_FAIL(quotactl(tc->cmd, "/dev/null", *tc->id, tc->addr),
>   			ENOTBLK, "quotactl()");
> -	else
> -		TST_EXP_FAIL(quotactl(tc->cmd, tst_device->dev, *tc->id, tc->addr),
> -			tc->exp_err, "quotactl()");
> +	} else {
> +		TST_EXP_FAIL(quotactl(tc->cmd, tst_device->dev, *tc->id,
> +			tc->addr), tc->exp_err, "quotactl()");
> +	}
> 
>   	if (quota_on) {
> -		TST_EXP_PASS_SILENT(quotactl(QCMD(Q_QUOTAOFF, USRQUOTA), tst_device->dev,
> -					fmt_id, usrpath), "quotactl with Q_QUOTAOFF");
> +		TST_EXP_PASS_SILENT(quotactl(QCMD(Q_QUOTAOFF, USRQUOTA),
> +			tst_device->dev, fmt_id, usrpath),
> +			"quotactl with Q_QUOTAOFF");
> +
>   		if (!TST_PASS)
>   			return;
>   	}
> @@ -169,7 +176,9 @@ static void setup(void)
>   {
>   	unsigned int i;
>   	const struct quotactl_fmt_variant *var =&fmt_variants[tst_variant];
> -	const char *const cmd[] = {"quotacheck", "-ugF", var->fmt_name, MNTPOINT, NULL};
> +	const char *const cmd[] = {
> +		"quotacheck", "-ugF", var->fmt_name, MNTPOINT, NULL
> +	};
> 
>   	tst_res(TINFO, "quotactl() with %s format", var->fmt_name);
>   	SAFE_CMD(cmd, NULL, NULL);


More information about the ltp mailing list