linux-unionfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Stancek <jstancek@redhat.com>
To: Amir Goldstein <amir73il@gmail.com>
Cc: overlayfs <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 12:17:06 -0400 (EDT)	[thread overview]
Message-ID: <701041971.55976403.1538583426048.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <CAOQ4uxjCgVYeG1eGUF1whFmMnorzaCk_d0KjXYni1=zpSwRHfQ@mail.gmail.com>



----- Original Message -----
> On Wed, Oct 3, 2018 at 3:47 PM Jan Stancek <jstancek@redhat.com> wrote:
> >
> >
> > ----- 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)
> >
> 
> Oops. better fix it anyway.
> I think it matters if /proc/pid/io does not exist.
> 
> >
> > > +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'?
> 
> I don't know. Not sure which tests are good candidates for that.
> But anyway it's a different change.
> 
> > Previously we used whatever fs /tmp was, now we seem to default
> > always to ext2.
> >
> 
> Not exactly. Before cleanup we either used whatever fs /tmp was
> or if it was tmpfs we created a loop backed default fs (ext2?).
> 
> Now we skip the conditional part and always format fs.
> Do you think that matters for the test?

Isn't the reason for your series to test on different fs as well? :-)

I don't have strong opinion on this, it's a test for "suggestion to
kernel", so it could also make it prone to report more false positives.
Feel free to ignore this comment for v2.

Regards,
Jan

> 
> Thanks,
> Amir.
> 

  reply	other threads:[~2018-10-03 16:17 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   ` [LTP] " Jan Stancek
2018-10-03 13:51     ` Amir Goldstein
2018-10-03 16:17       ` Jan Stancek [this message]
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=701041971.55976403.1538583426048.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).