From: Ian Pilcher <arequipeno@gmail.com>
To: linux-bcache@vger.kernel.org
Subject: "device busy" error when registering device
Date: Fri, 18 Jul 2014 19:11:50 -0500 [thread overview]
Message-ID: <lqcd46$hvl$1@ger.gmane.org> (raw)
I just finished moving my existing Fedora 20 root filesystem onto a
bcache device (actually LVM on top of a bcache physical volume).
The bcache cache device is /dev/sda2, a partition on my SSD; the backing
device is /dev/md126p5, a partition on an Intel RAID (imsm) volume.
This configuration only boots successfully about 50% of the time. The
other 50% of the time, the bcache device is not created, and dracut
times out and dumps me into an emergency shell.
After changing the bcache-register script to use /sys/fs/bcache/register
(instead of register_quiet), I see a "device busy" error when udev
attempts to register the backing device:
[ 2.105581] bcache: register_bcache() error opening /dev/md126p5:
device busy
This is kernel 3.5.15, so this doesn't mean that the device is already
registered; something else has it (temporarily) opened. I say that it's
opened temporarily, because I am able to register the backing device
manually from the dracut shell -- which starts the the bcache device.
Looking at /usr/lib/udev/bcache-register and the bcache_register source
in drivers/md/bcache/super.c, I notice 2 things.
(1) bcache-register gives up immediately when an error occurs because of
a (possibly temporary) conflict.
(2) Although the driver logs a different message in the already
registered case ("device already registered" instead of "device
busy"), it doesn't provide userspace with any way to distinguish the
two cases; it always returns -EINVAL.
Suggested fix:
(1) Change bcache_register to return -EBUSY in the device busy case
(while still returning -EINVAL in the already registered case).
(2) Change bcache-register to check the exit code of the registration
attempt and retry in the EBUSY case.
Does this make sense?
--
========================================================================
Ian Pilcher arequipeno@gmail.com
-------- "I grew up before Mark Zuckerberg invented friendship" --------
========================================================================
next reply other threads:[~2014-07-19 0:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-19 0:11 Ian Pilcher [this message]
2014-07-19 7:23 ` "device busy" error when registering device Josep Lladonosa
2014-07-22 4:46 ` Ian Pilcher
2014-07-22 5:13 ` RFC: Handle "device busy" error when registering Ian Pilcher
2014-07-23 3:43 ` Ian Pilcher
2014-08-13 20:24 ` "device busy" error when registering device Rolf Fokkens
2014-08-20 1:38 ` Ian Pilcher
2014-09-06 7:34 ` Rolf Fokkens
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='lqcd46$hvl$1@ger.gmane.org' \
--to=arequipeno@gmail.com \
--cc=linux-bcache@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 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.