From: Karel Zak <kzak@redhat.com>
To: Ruediger Meier <sweet_f_a@gmx.de>
Cc: util-linux@vger.kernel.org
Subject: Re: sfdisk, re-eading partition table fails
Date: Tue, 15 Dec 2015 11:24:12 +0100 [thread overview]
Message-ID: <20151215102408.GG2353@ws.net.home> (raw)
In-Reply-To: <201512141311.59328.sweet_f_a@gmx.de>
On Mon, Dec 14, 2015 at 01:11:59PM +0100, Ruediger Meier wrote:
> our test suite shows that many sfdisk tests fail sometimes to "Re-read
> partition table" at the end. I was able to find some systems where
> I could re-produce the problem using the script below.
Yes, the problem is probably udev, and "udevadm settle" is not always
enough.
> Seems that the problem is because of the first BLKRRPART ioctl call
> in sfdisk.c function is_device_used(). Maybe it cause udev or
> whatever to open the device and then the real BLKRRPART in
> write_changes() fails.
but the device has to be already partitioned, on disk without
partitions BLKRRPART (and is_device_used()) does not generate any
events (try "udevadm monitor").
> Removing the first BLKRRPART ioctl (or sleeping about 50ms after the first one)
> "fixes" the issue.
The is_device_used() in the sfdisk is nothing elegant, maybe
we can use --noreread sfdisk command line option in the tests.
Anyway, it would be nice to have some in-sfdisk solution, because our
users who use fdisk in scripts may be affected by the same problem.
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
next prev parent reply other threads:[~2015-12-15 10:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-14 12:11 sfdisk, re-eading partition table fails Ruediger Meier
2015-12-15 10:24 ` Karel Zak [this message]
2015-12-15 12:26 ` Ruediger Meier
2015-12-15 13:33 ` Karel Zak
2015-12-18 14:32 ` Ruediger Meier
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=20151215102408.GG2353@ws.net.home \
--to=kzak@redhat.com \
--cc=sweet_f_a@gmx.de \
--cc=util-linux@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox