diff options
author | Alex Elder <elder@inktank.com> | 2012-11-16 09:29:16 -0600 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-01-17 08:46:49 -0800 |
commit | f14e81d15cd37d89b880226f2ad3b234e8e629c7 (patch) | |
tree | c0bfc5a3871f58d501034691debdfe3e1e1217bb /lib/bitmap.c | |
parent | a35420155f46065b5fded0a7478fff003be4e872 (diff) |
rbd: do not allow remove of mounted-on image
(cherry picked from commit 42382b709bd1d143b9f0fa93e0a3a1f2f4210707)
There is no check in rbd_remove() to see if anybody holds open the
image being removed. That's not cool.
Add a simple open count that goes up and down with opens and closes
(releases) of the device, and don't allow an rbd image to be removed
if the count is non-zero.
Protect the updates of the open count value with ctl_mutex to ensure
the underlying rbd device doesn't get removed while concurrently
being opened.
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'lib/bitmap.c')
0 files changed, 0 insertions, 0 deletions