All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [RFC PATCH 1/8] lib/tst_test.c: mntpoint implies tmpdir
Date: Tue, 10 Apr 2018 12:21:15 +0200	[thread overview]
Message-ID: <20180410102115.GE23143@rei> (raw)
In-Reply-To: <5ACC87D9.2040205@cn.fujitsu.com>

Hi!
> > Ah, right, we do have the condition up there, but it does not work for
> > needs_rofs for example that utilizes mntpoint as well.
> >
> > So the correct patch should be:
> >
> > diff --git a/lib/tst_test.c b/lib/tst_test.c
> > index 8be13327c..05ba95e2e 100644
> > --- a/lib/tst_test.c
> > +++ b/lib/tst_test.c
> > @@ -638,6 +638,7 @@ static int needs_tmpdir(void)
> >   {
> >          return tst_test->needs_tmpdir ||
> >                 tst_test->needs_device ||
> > +              tst_test->mntpoint ||
> >                 tst_test->resource_files ||
> >                 tst_test->needs_checkpoints;
> >   }
> >
> > Which will ensure that the test library will not create files outside of
> > the test temporary directory.
> Hi Cyril,
> 
> For needs_rofs flag, this patch looks good to me.
> 
> Besides, can we repalce needs_device with mount_device in needs_tmpdir() ?
> I think just needs_device flag needn't create a temporary directory(e.g. 
> ioctl06).

Actually we can't since unless user passes path to a real device via the
LTP_DEV env variable the loop device is backed by a temporary file that
has to be created somewhere. See the tst_device.c and the
tst_acquire_device__() function.

-- 
Cyril Hrubis
chrubis@suse.cz

  reply	other threads:[~2018-04-10 10:21 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-05 14:01 [LTP] Make use of .needs_rofs Cyril Hrubis
2018-04-05 14:01 ` [LTP] [RFC PATCH 1/8] lib/tst_test.c: mntpoint implies tmpdir Cyril Hrubis
2018-04-10  8:58   ` Xiao Yang
2018-04-10  9:14     ` Cyril Hrubis
2018-04-10  9:46       ` Xiao Yang
2018-04-10 10:21         ` Cyril Hrubis [this message]
2018-04-05 14:01 ` [LTP] [RFC PATCH 2/8] lib/tst_test: Populate the read-only fs Cyril Hrubis
2018-04-18 14:29   ` Cyril Hrubis
2018-04-23  8:45   ` Petr Vorel
2018-04-23 13:59     ` Cyril Hrubis
2018-04-05 14:01 ` [LTP] [RFC PATCH 3/8] syscalls/chmod06: Rewrite the new library Cyril Hrubis
2018-04-05 14:01 ` [LTP] [RFC PATCH 4/8] syscalls/rmdir02: Make use of .needs_rofs Cyril Hrubis
2018-04-05 14:01 ` [LTP] [RFC PATCH 5/8] syscalls/mkdirat02: Rewrite to the new library Cyril Hrubis
2018-04-05 14:01 ` [LTP] [RFC PATCH 6/8] syscalls/link08: " Cyril Hrubis
2018-04-05 14:01 ` [LTP] [RFC PATCH 7/8] syscalls/utimes01: " Cyril Hrubis
2018-04-05 14:01 ` [LTP] [RFC PATCH 8/8] syscalls/fchmod06: Convert " Cyril Hrubis

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=20180410102115.GE23143@rei \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    /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.