From: Josh Durgin <josh.durgin@inktank.com>
To: Tommi Virtanen <tv@inktank.com>
Cc: Travis Rhoden <trhoden@gmail.com>, ceph-devel@vger.kernel.org
Subject: Re: can "rbd unmap" detect if device is mounted?
Date: Mon, 16 Jul 2012 17:43:40 -0700 [thread overview]
Message-ID: <5004B53C.9020705@inktank.com> (raw)
In-Reply-To: <CADvuQREm_PCatUUdgUjsUNMNBNEtB9_z9LTvo9D0Gyq7dR8XeQ@mail.gmail.com>
On 07/16/2012 04:37 PM, Tommi Virtanen wrote:
> On Mon, Jul 16, 2012 at 3:43 PM, Josh Durgin<josh.durgin@inktank.com> wrote:
>>> I've made this mistake a couple of times now (completely my fault,
>>> when will I learn?), and am wondering if a bit of protection can be
>>> put in place against user errors.
>> Yeah, we've been working on advisory locking. The first step is
>> just adding an option to lock via the rbd command line tool, so you
>> could script lock/map and unmap/unlock.
>
> Is his problem really about the locking?
>
> It sounded to me like, he has something (the mount) referencing a
> block device, and we're letting the block device disappear.
>
> The locking you guys have been talking about sounds like that lock
> would be held whenever the image is mapped, regardless of whether it's
> mounted or not (think mkfs).
>
>
> Should unmap even be possible while the block device is open?
> Shouldn't there be a refcount and an -EBUSY? That's what other block
> device providers do:
That would be the best solution. Looking into it, the rbd driver
is already keeping a refcount just like the loop driver (in
block_device_operations .open/.release). The rbd driver is only using
it for the struct device though, instead of struct rbd_device. This
shouldn't be too hard to fix.
Josh
next prev parent reply other threads:[~2012-07-17 0:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-16 19:59 can "rbd unmap" detect if device is mounted? Travis Rhoden
2012-07-16 22:43 ` Josh Durgin
2012-07-16 23:00 ` Travis Rhoden
2012-07-16 23:37 ` Tommi Virtanen
2012-07-17 0:43 ` Josh Durgin [this message]
2012-07-17 3:34 ` Travis Rhoden
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=5004B53C.9020705@inktank.com \
--to=josh.durgin@inktank.com \
--cc=ceph-devel@vger.kernel.org \
--cc=trhoden@gmail.com \
--cc=tv@inktank.com \
/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.