public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Martin Doucha <mdoucha@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v3] move_mount03: check allow to mount beneath top mount
Date: Wed, 20 Mar 2024 10:54:59 +0100	[thread overview]
Message-ID: <20240320095459.GA466582@pevik> (raw)
In-Reply-To: <8798c323-8298-49b1-9950-09f2a7c309cb@suse.cz>

> On 20. 03. 24 8:43, Petr Vorel wrote:
> > > On 28. 12. 23 3:55, Wei Gao via ltp wrote:
> > > > +static void cleanup(void)
> > > > +{
> > > > +	if (tst_is_mounted_at_tmpdir(DIRA))
> > > > +		SAFE_UMOUNT(DIRA);
> > > > +
> > > > +	if (tst_is_mounted_at_tmpdir(DIRB))
> > > > +		SAFE_UMOUNT(DIRB);

> > > I believe that DIRB may need to be unmounted twice here. Also please close
> > > fda and fdb here if they're still open.

> > What would do the second mount? move_mount() ?

> > There are SAFE_UMOUNT() in the end of the testing function, that's why usually
> > even these 2 SAFE_UMOUNT() aren't needed (but obviously we need to add them if
> > SAFE_TOUCH() or something quits testing early):

> > move_mount03.c:92: TPASS: move_mount(fda, "", fdb, "", MOVE_MOUNT_BENEATH | MOVE_MOUNT_F_EMPTY_PATH | MOVE_MOUNT_T_EMPTY_PATH) passed
> > move_mount03.c:98: TPASS: access(DIRB "/B", F_OK) passed
> > move_mount03.c:99: TINFO: Umounting /tmp/LTP_movqeTZGu/LTP_DIR_B
> > move_mount03.c:100: TPASS: access(DIRB "/A", F_OK) passed
> > move_mount03.c:102: TINFO: Umounting /tmp/LTP_movqeTZGu/LTP_DIR_B
> > move_mount03.c:103: TINFO: Umounting /tmp/LTP_movqeTZGu/LTP_DIR_A
> > tst_device.c:442: TINFO: No device is mounted at /tmp/LTP_movqeTZGu/LTP_DIR_A
> > tst_device.c:442: TINFO: No device is mounted at /tmp/LTP_movqeTZGu/LTP_DIR_B

> Yes, open_tree() was called with OPEN_TREE_CLONE so after move_mount(), the
> mounts look like this:
> - tmpfs[1] at DIRA
> - tmpfs[1] at DIRB
> - tmpfs[2] at DIRB

> If either SAFE_CLOSE() immediately after move_mount() fails, cleanup() will
> unmount tmpfs[1] from DIRA and tmpfs[2] from DIRB but leave tmpfs[1] mounted
> at DIRB.

@Martin Thanks!
@Wai Please send another version.

Kind regards,
Petr

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

  reply	other threads:[~2024-03-20  9:55 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-13 10:15 [LTP] [PATCH v1] move_mount03: check allow to mount beneath top mount Wei Gao via ltp
2023-11-14  9:17 ` Richard Palethorpe
2023-12-26 15:11   ` Wei Gao via ltp
2023-12-27  0:04 ` [LTP] [PATCH v2] " Wei Gao via ltp
2023-12-27 14:26   ` Petr Vorel
2023-12-28  2:53     ` Wei Gao via ltp
2023-12-28  2:55   ` [LTP] [PATCH v3] " Wei Gao via ltp
2024-03-06 17:24     ` Martin Doucha
2024-03-20  7:43       ` Petr Vorel
2024-03-20  9:25         ` Martin Doucha
2024-03-20  9:54           ` Petr Vorel [this message]
2024-03-21  4:46           ` Petr Vorel
2024-03-22 11:20     ` [LTP] [PATCH v4] " Wei Gao via ltp
2024-05-17 14:48       ` Martin Doucha
2024-06-03  7:38         ` Petr Vorel
2024-06-05 10:59       ` [LTP] [PATCH v5] " Wei Gao via ltp
2025-02-21 10:35         ` Petr Vorel

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=20240320095459.GA466582@pevik \
    --to=pvorel@suse.cz \
    --cc=ltp@lists.linux.it \
    --cc=mdoucha@suse.cz \
    /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