public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Yang Xu <xuyang2018.jy@fujitsu.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v1] syscalls/mount07: Add new test case for MS_NOSYMFOLLOW
Date: Tue, 7 Feb 2023 19:12:13 +0100	[thread overview]
Message-ID: <Y+KUfW2BYCddeZcY@pevik> (raw)
In-Reply-To: <1675156318-14860-1-git-send-email-xuyang2018.jy@fujitsu.com>

Hi Xu,

> +static void test_statfs(bool nosymfollow)
> +{
> +	struct statfs buf;
> +
> +	SAFE_STATFS(MNTPOINT, &buf);
> +	if (buf.f_flags & ST_NOSYMFOLLOW) {
> +		tst_res(nosymfollow ? TPASS : TFAIL, "ST_NOSYMFOLLOW set on %s",
> +				MNTPOINT);
> +	} else {
> +		tst_res(nosymfollow ? TFAIL : TPASS, "ST_NOSYMFOLLOW not set on %s",
> +				MNTPOINT);
> +	}
> +}

I was thinking about this:

static void test_statfs(bool nosymfollow)
{
	struct statfs buf;
	bool st_nosymfollow;
	int res;

	SAFE_STATFS(MNTPOINT, &buf);
	st_nosymfollow = buf.f_flags & ST_NOSYMFOLLOW;
	res = !!st_nosymfollow == !!nosymfollow ? TPASS : TFAIL;

	tst_res(res, "ST_NOSYMFOLLOW %sset on %s", st_nosymfollow ? "" : "not ",
		MNTPOINT);
}
but your version is much readable, thus forget the above.

LGTM, thanks!
Reviewed-by: Petr Vorel <pvorel@suse.cz>

Kind regards,
Petr

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

  reply	other threads:[~2023-02-07 18:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-31  9:11 [LTP] [PATCH v1] syscalls/mount07: Add new test case for MS_NOSYMFOLLOW Yang Xu
2023-02-07 18:12 ` Petr Vorel [this message]
2023-02-09  3:25   ` 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=Y+KUfW2BYCddeZcY@pevik \
    --to=pvorel@suse.cz \
    --cc=ltp@lists.linux.it \
    --cc=xuyang2018.jy@fujitsu.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox