[lxc-devel] [lxd/master] lxd/storage/cephfs: Don't fail if already mounted
stgraber on Github
lxc-bot at linuxcontainers.org
Wed Nov 6 21:56:07 UTC 2019
A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 354 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20191106/850a7cf6/attachment.bin>
-------------- next part --------------
From de4d0b535631fb9769a45ab42a88d6c3b9b28afa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Wed, 6 Nov 2019 16:20:38 -0500
Subject: [PATCH] lxd/storage/cephfs: Don't fail if already mounted
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
lxd/storage/drivers/driver_cephfs.go | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/lxd/storage/drivers/driver_cephfs.go b/lxd/storage/drivers/driver_cephfs.go
index 0cbb919d25..cebc07efe9 100644
--- a/lxd/storage/drivers/driver_cephfs.go
+++ b/lxd/storage/drivers/driver_cephfs.go
@@ -238,6 +238,11 @@ func (d *cephfs) Delete(op *operations.Operation) error {
}
func (d *cephfs) Mount() (bool, error) {
+ // Check if already mounted.
+ if shared.IsMountPoint(GetPoolMountPath(d.name)) {
+ return false, nil
+ }
+
// Parse the namespace / path.
fields := strings.SplitN(d.config["cephfs.path"], "/", 2)
fsName := fields[0]
More information about the lxc-devel
mailing list