From afbe47a382d01a5372988a71717fa6633e3817c7 Mon Sep 17 00:00:00 2001 From: Jeffrey Zhang Date: Thu, 22 Feb 2018 12:31:06 +0800 Subject: [PATCH] Log warning message when failed to remove rbd lock It is hard to debug without any error message when lock is not removed successfully. --- pkg/volume/rbd/rbd_util.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/volume/rbd/rbd_util.go b/pkg/volume/rbd/rbd_util.go index bbb936b1290..650f8b50873 100644 --- a/pkg/volume/rbd/rbd_util.go +++ b/pkg/volume/rbd/rbd_util.go @@ -213,6 +213,8 @@ func (util *RBDUtil) rbdUnlock(b rbdMounter) error { cmd, err = b.exec.Run("rbd", args...) if err == nil { glog.V(4).Infof("rbd: successfully remove lock (locker_id: %s) on image: %s/%s with id %s mon %s", lock_id, b.Pool, b.Image, b.Id, mon) + } else { + glog.Warningf("rbd: failed to remove lock (lock_id: %s) on image: %s/%s with id %s mon %s: %v", lock_id, b.Pool, b.Image, b.Id, mon, err) } }