From 68afa28b27f922f1cdf5e872549a870ff2a84401 Mon Sep 17 00:00:00 2001 From: Chaitanya Bankanhal Date: Fri, 12 Jun 2020 16:11:29 +0530 Subject: [PATCH] rc: Add mount to list if mount point was successfully created --- cmd/mountlib/rc.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cmd/mountlib/rc.go b/cmd/mountlib/rc.go index d9e716245..ebd545613 100644 --- a/cmd/mountlib/rc.go +++ b/cmd/mountlib/rc.go @@ -93,16 +93,18 @@ func mountRc(_ context.Context, in rc.Params) (out rc.Params, err error) { if mountFns[mountType] != nil { _, _, unmountFn, err := mountFns[mountType](fdst, mountPoint) + if err != nil { + log.Printf("mount FAILED: %v", err) + return nil, err + } + // Add mount to list if mount point was successfully created liveMounts[mountPoint] = MountInfo{ unmountFn: unmountFn, MountedOn: time.Now(), Fs: fdst.Name(), MountPoint: mountPoint, } - if err != nil { - log.Printf("mount FAILED: %v", err) - return nil, err - } + fs.Debugf(nil, "Mount for %s created at %s using %s", fdst.String(), mountPoint, mountType) return nil, nil }