From: Jan Stancek <jstancek@redhat.com>
To: Amir Goldstein <amir73il@gmail.com>
Cc: linux-unionfs@vger.kernel.org, ltp@lists.linux.it,
Miklos Szeredi <miklos@szeredi.hu>,
Cyril Hrubis <chrubis@suse.cz>
Subject: Re: [LTP] [PATCH 2/4] syscalls/readahead02: Convert to newlib and cleanup
Date: Wed, 3 Oct 2018 08:47:51 -0400 (EDT) [thread overview]
Message-ID: <1801488452.55763249.1538570871657.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <20180928130621.28932-3-amir73il@gmail.com>
----- Original Message -----
> * Use SAFE macros
>
> * Use SPDX-License-Identifier
>
> * No need to cleanup test file from temp dir
>
> Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Hi,
ack to 1/4
>
> static int has_file(const char *fname, int required)
> {
> - int ret;
> struct stat buf;
> - ret = stat(fname, &buf);
> - if (ret == -1) {
> - if (errno == ENOENT)
> - if (required)
> - tst_brkm(TCONF, cleanup, "%s not available",
> - fname);
> - else
> - return 0;
> - else
> - tst_brkm(TBROK | TERRNO, cleanup, "stat %s", fname);
> +
> + if (stat(fname, &buf) == -1) {
> + if (errno != ENOENT)
> + tst_brk(TBROK | TERRNO, "stat %s", fname);
> + if (required)
> + tst_brk(TCONF, "%s not available", fname);
> }
> return 1;
> }
This will return 1 even when file doesn't exist.
(Not that it makes big difference for test)
<snip>
> +static struct tst_test test = {
> + .needs_root = 1,
> + .needs_tmpdir = 1,
> + .mount_device = 1,
> + .mntpoint = mntpoint,
> + .setup = setup,
> + .options = options,
> + .test_all = test_readahead,
> +};
Would it make sense to enable this for 'all_filesystems = 1'?
Previously we used whatever fs /tmp was, now we seem to default
always to ext2.
Regards,
Jan
>
> #else /* __NR_readahead */
> -int main(void)
> -{
> - tst_brkm(TCONF, NULL, "System doesn't support __NR_readahead");
> -}
> + TST_TEST_TCONF("System doesn't support __NR_readahead");
> #endif
> --
> 2.17.1
>
>
> --
> Mailing list info: https://lists.linux.it/listinfo/ltp
>
next prev parent reply other threads:[~2018-10-03 12:47 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-28 13:06 [PATCH 0/4] Tests for readahead() and fadvise() on overlayfs Amir Goldstein
2018-09-28 13:06 ` [PATCH 1/4] syscalls/readahead01: Convert to newlib Amir Goldstein
2018-09-28 13:06 ` [PATCH 2/4] syscalls/readahead02: Convert to newlib and cleanup Amir Goldstein
2018-10-03 12:47 ` Jan Stancek [this message]
2018-10-03 13:51 ` [LTP] " Amir Goldstein
2018-10-03 16:17 ` Jan Stancek
2018-10-04 6:15 ` Amir Goldstein
2018-09-28 13:06 ` [PATCH 3/4] syscalls/readahead02: test readahead() on an overlayfs file Amir Goldstein
2018-10-03 12:48 ` [LTP] " Jan Stancek
2018-10-03 13:30 ` Amir Goldstein
2018-09-28 13:06 ` [PATCH 4/4] syscalls/readahead02: test readahead using posix_fadvise() Amir Goldstein
2018-10-03 12:48 ` [LTP] " Jan Stancek
2018-10-03 13:37 ` Amir Goldstein
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=1801488452.55763249.1538570871657.JavaMail.zimbra@redhat.com \
--to=jstancek@redhat.com \
--cc=amir73il@gmail.com \
--cc=chrubis@suse.cz \
--cc=linux-unionfs@vger.kernel.org \
--cc=ltp@lists.linux.it \
--cc=miklos@szeredi.hu \
/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;
as well as URLs for NNTP newsgroup(s).