Linux Test Project
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Cyril Hrubis <chrubis@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v3 2/2] mount03: Convert to new API
Date: Tue, 16 Aug 2022 11:18:14 +0200	[thread overview]
Message-ID: <Yvtg1gjOJaxNXgKi@pevik> (raw)
In-Reply-To: <YvteNq9F1YuhsD8J@yuki>

Hi Cyril,

> > +++ b/testcases/kernel/syscalls/mount/mount03.c
> > @@ -1,389 +1,202 @@
> > +// SPDX-License-Identifier: GPL-2.0-or-later
> >  /*
> > + * Copyright (c) Linux Test Project, 2022
> >   * Copyright (c) Wipro Technologies Ltd, 2002.  All Rights Reserved.
> > - *
> > - * This program is free software; you can redistribute it and/or modify it
> > - * under the terms of version 2 of the GNU General Public License as
> > - * published by the Free Software Foundation.

> This is GPL-2.0 not GPL-2.0-or-later
+1, sorry for overlooking this.

> > -/*
> > - * DESCRIPTION
> > - *	Check for basic mount(2) system call flags.
> > +/*\
> > + * [Description]
> >   *
> > - *	Verify that mount(2) syscall passes for each flag setting and validate
> > - *	the flags
> > - *	1) MS_RDONLY - mount read-only.
> > - *	2) MS_NODEV - disallow access to device special files.
> > - *	3) MS_NOEXEC - disallow program execution.
> > - *	4) MS_SYNCHRONOUS - writes are synced at once.
> > - *	5) MS_REMOUNT - alter flags of a mounted FS.
> > - *	6) MS_NOSUID - ignore suid and sgid bits.
> > - *	7) MS_NOATIME - do not update access times.
> > + * Verify mount(2) for various flags.
> >   */

> Can we please be a bit more verbose here?
Sure, that was my change. Do you want me to put the original description or
would be this enough?

Verify mount(2) run with various flags (e.g. MS_RDONLY, MS_NOEXEC).

=> i.e. what are you missing? I'm not a big fan of listing all features tested,
but if you prefer I'll put the original description.

...
> > +static void test_synchronous(void)
> > +{
> > +	strcpy(wbuf, TEST_STR);
> > +	snprintf(file, PATH_MAX, "%s/synchronous", MNTPOINT);
> > +	otfd = SAFE_OPEN(file, O_RDWR | O_CREAT, FILE_MODE);
> > +	SAFE_WRITE(1, otfd, wbuf, strlen(wbuf));
> > +	SAFE_LSEEK(otfd, 0, SEEK_SET);
> > +	SAFE_READ(0, otfd, rbuf, sizeof(rbuf));
> > +	TST_EXP_EQ_STR(rbuf, wbuf);
> > +}

> This is completely bogus check, this has to work regardless of the
> MS_SYNCHRONOUS. The only way how to check MS_SYNCHRONOUS would be
> pulling out the device just after write before page cache had a chance
> to write out data but not before the disk flushes its caches.

> I guess that it may be possible to check this if create a loop device,
> mount it MS_SYNCHRONOUS, write to a file on the loop device and check
> that the data has been written to the underlying file. But that would
> be completely different and quite complex test.

OK, I suggest to remove this test and put your suggestion for new to issues.

Also looking to the man page we're missing test for MS_LAZYTIME (since 4.O) and
MS_NOSYMFOLLOW (5.10).

And I'll drop TST_EXP_EQ_STR() unless you think it's useful.

Kind regards,
Petr

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

  reply	other threads:[~2022-08-16  9:18 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-11 13:57 [LTP] [PATCH v3 0/2] mount03: Convert to new API Petr Vorel
2022-08-11 13:57 ` [LTP] [PATCH v3 1/2] tst_test_macros.h: Add TST_EXP_EQ_STR Petr Vorel
2022-08-15  3:17   ` xuyang2018.jy
2022-08-11 13:57 ` [LTP] [PATCH v3 2/2] mount03: Convert to new API Petr Vorel
2022-08-16  9:07   ` Cyril Hrubis
2022-08-16  9:18     ` Petr Vorel [this message]
2022-08-16  9:31       ` Cyril Hrubis
2022-08-15  5:15 ` [LTP] [PATCH v3 0/2] " xuyang2018.jy
2022-08-15  6:40   ` Petr Vorel
2022-08-15  6:58     ` xuyang2018.jy
2022-08-15  8:28       ` Petr Vorel
2022-08-15  9:57         ` xuyang2018.jy
2022-08-15 14:19           ` Petr Vorel
2022-08-16  3:40             ` xuyang2018.jy
2022-08-16 11:49               ` Petr Vorel
2022-08-16 13:01                 ` Petr Vorel
2022-08-17  2:23                   ` xuyang2018.jy
2022-08-22 13:28           ` Petr Vorel
2022-08-22 13:35             ` Petr Vorel
2022-08-16  4:37     ` xuyang2018.jy
2022-08-16  6:57       ` Petr Vorel
2022-08-16  7:28         ` xuyang2018.jy
2022-08-16  9:00       ` Cyril Hrubis
2022-08-16  9:06         ` Petr Vorel
2022-08-16  9:57           ` 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=Yvtg1gjOJaxNXgKi@pevik \
    --to=pvorel@suse.cz \
    --cc=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox