All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: Li Wang <liwang@redhat.com>
Cc: rafael.tinoco@linaro.org, ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] tst_umount: Retry open() after umount to handle delayed device release
Date: Wed, 6 Aug 2025 11:27:23 +0200	[thread overview]
Message-ID: <aJMf-6DEu-9NzLAJ@yuki.lan> (raw)
In-Reply-To: <20250806074405.14890-1-liwang@redhat.com>

Hi!
> Currently, tst_umount() in lib/tst_device.c tries to repeatedly umount()
> a mount point, with a retry loop if it gets EBUSY. However, after umount()
> reports success, devices (especially loop devices) can still be held open
> by another process or kernel, delaying their actual release. This can lead
> to race conditions when the next operation tries to reuse the device like
> mkfs.ext3 error:

This looks like working around a kernel bug to me. The umount() without
MNT_DETACH should make the device reusable once the syscall returns back
to the userspace. At least I wouldn't add this code to LTP unless kernel
devs tells us that this broken behavior is to be expected.

-- 
Cyril Hrubis
chrubis@suse.cz

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

  reply	other threads:[~2025-08-06  9:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-19 16:33 [LTP] lib: tst_device.c - /dev/loop0 in use Rafael David Tinoco
2019-01-02 13:19 ` Cyril Hrubis
2025-08-06  7:44   ` [LTP] [PATCH] tst_umount: Retry open() after umount to handle delayed device release Li Wang via ltp
2025-08-06  9:27     ` Cyril Hrubis [this message]
2025-08-11 12:42       ` Li Wang via ltp
2025-08-11 14:20         ` Cyril Hrubis
2025-08-12  3:43           ` Li Wang via ltp
2025-08-12 11:17             ` 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=aJMf-6DEu-9NzLAJ@yuki.lan \
    --to=chrubis@suse.cz \
    --cc=liwang@redhat.com \
    --cc=ltp@lists.linux.it \
    --cc=rafael.tinoco@linaro.org \
    /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.