linux-bcache.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rolf Fokkens <rolf@rolffokkens.nl>
To: linux-bcache@vger.kernel.org
Subject: Re: "device busy" error when registering device
Date: Sat, 6 Sep 2014 07:34:58 +0000 (UTC)	[thread overview]
Message-ID: <loom.20140906T092457-907@post.gmane.org> (raw)
In-Reply-To: 53F3FC24.4000200@gmail.com

Ian Pilcher <arequipeno <at> gmail.com> writes:

> I suspect that the most significant difference is that my backing device
> is a partition on a RAID device, rather than the device itself.
> In reality, however, I don't think it's worth spending a lot of time
> figuring out exactly what else is accessing the device.  If I understand
> udev correctly, this sort of "conflict" is an inevitable consequence of
> its asynchronous nature, and helper programs like bcache-register need
> to be robust enough to deal with them.
> 
> (If I'm wrong about this, then I guess this is a udev bug?)
> 
> BTW, this is what the bcache-related dmesg entries look like when I hit
> the conflict with my patches applied:
> 
> > [    1.761932] bcache: bch_journal_replay() journal replay done, 1972
keys in 75 entries, seq 312536
> > [    1.762043] bcache: register_cache() registered cache device sda2
> > [    1.762631] bcache: register_bcache() error opening /dev/md126p5:
device busy
> > [    1.862949] bcache: register_bdev() registered backing device md126p5
> > [    1.864268] bcache: bch_cached_dev_attach() Caching md126p5 as
bcache0 on set fb8d253b-6144-4b48-8ed6-7b1724ed83a7
> > [    3.553053] bcache: register_bcache() error opening /dev/sda2: device
already registered
> > [    4.182180] bcache: register_bcache() error opening /dev/md126p5:
device already registered
> 
> You can see that the backing device is busy when it first tries to
> register it, but it succeeds 1/10th of a second later.  (I'm assuming
> the last two "already registered" messages occur when udev replays
> its events later in the boot process.)

To me your assumption makes sense. I would be good though if Gabriel (bcache
userspace) and/or Kent (bcache kernel) would respond to this.

I'll add some retries to bcache tools (in case of any error) and see if that
works and add a pull request here: https://github.com/g2p/bcache-tools

      reply	other threads:[~2014-09-06  7:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-19  0:11 "device busy" error when registering device Ian Pilcher
2014-07-19  7:23 ` 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 [this message]

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=loom.20140906T092457-907@post.gmane.org \
    --to=rolf@rolffokkens.nl \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).