All of lore.kernel.org
 help / color / mirror / Atom feed
From: "xuyang2018.jy@fujitsu.com" <xuyang2018.jy@fujitsu.com>
To: Martin Doucha <mdoucha@suse.cz>
Cc: "ltp@lists.linux.it" <ltp@lists.linux.it>
Subject: Re: [LTP] [PATCH 2/3] quotactl06: Code style fixes
Date: Fri, 4 Mar 2022 01:36:22 +0000	[thread overview]
Message-ID: <62216D4D.9050806@fujitsu.com> (raw)
In-Reply-To: <20220303153131.3372-2-mdoucha@suse.cz>

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);

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2022-03-04  1:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-03 15:31 [LTP] [PATCH 1/3] quotactl06: Replace tst_brk(TFAIL) with TBROK Martin Doucha
2022-03-03 15:31 ` [LTP] [PATCH 2/3] quotactl06: Code style fixes Martin Doucha
2022-03-04  1:36   ` xuyang2018.jy [this message]
2022-03-03 15:31 ` [LTP] [PATCH 3/3] quotactl06: Fix TESTDIR1 cleanup if setup() exits early Martin Doucha
2022-03-04  1:38   ` xuyang2018.jy
2022-03-04  9:24     ` Martin Doucha
2022-03-04 10:00       ` xuyang2018.jy
2022-03-04  1:35 ` [LTP] [PATCH 1/3] quotactl06: Replace tst_brk(TFAIL) with TBROK xuyang2018.jy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=62216D4D.9050806@fujitsu.com \
    --to=xuyang2018.jy@fujitsu.com \
    --cc=ltp@lists.linux.it \
    --cc=mdoucha@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.