From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] lib: tst_device.c - /dev/loop0 in use
Date: Wed, 2 Jan 2019 14:19:13 +0100 [thread overview]
Message-ID: <20190102131913.GA26215@rei.lan> (raw)
In-Reply-To: <de5fb563-4273-7132-f94d-887e6e211672@linaro.org>
Hi!
> Apparently, when having "all_filesystems" flag set for one test, there
> is a room of opportunity for the subsequent filesystems tests to find
> the device, acquired by "tst_acquire_device()", busy.
>
> I suppose, in the case bellow, fsync() caused async work in some kernel
> thread to cause the "/dev/loop0 is apparently in use by the system"
> error when trying a new mkfs.XXXX call - for the subsequent filesystem -
> using the same acquired device.
>
> With the "all_filesystems" logic, the acquired device is not detached,
> nor find_free_loopdev() is called again, which *could* mitigate this.
Right, we expect that the device is free to be reused once the umount()
returns to the userspace, which apparently is not true in your case.
Looking into the mkfs code it tries to open() the device RDONLY and we
get this error if the attempt has failed with EBUSY, which likely means
that the umount() is still running in background in kernel.
I guess that we may as well patch the tst_umount() function in
lib/tst_device.c to loop until open() fails with EBUSY in the similar
manner we attempt to retry umount() there.
--
Cyril Hrubis
chrubis@suse.cz
next prev parent reply other threads:[~2019-01-02 13:19 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 [this message]
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
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=20190102131913.GA26215@rei.lan \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox