Re: can "rbd unmap" detect if device is mounted?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 07/16/2012 04:37 PM, Tommi Virtanen wrote:
On Mon, Jul 16, 2012 at 3:43 PM, Josh Durgin<josh.durgin@xxxxxxxxxxx>  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
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux