From e312b0807b51120942d95d482ddce7a51ebbacc8 Mon Sep 17 00:00:00 2001 From: Emmanuel Dreyfus Date: Fri, 23 Jan 2015 11:28:50 +0100 Subject: glusterd: Fix spurious volume delete failure If volume uses quota, volume delete operation should unmount the auxiliary quota mount usin glusterd_remove_auxiliary_mount(). This may fail with EBADF is the mount is already gone. In that situation, ignore the error so that volume delete succeeds. This fixes a spurious failure on NetBSD in tests/basic/quota.t 74-75 Backport of I69325f71fc2c8af254db46f696c8669a4e6bd7e4 BUG: 1138897 Change-Id: If0d382d44a956bb9fd8c41299f82affdf2ee0618 Signed-off-by: Emmanuel Dreyfus Reviewed-on: http://review.gluster.org/9484 Tested-by: Gluster Build System Reviewed-by: Krishnan Parthasarathi Tested-by: Krishnan Parthasarathi --- xlators/mgmt/glusterd/src/glusterd-utils.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 16bf424ae51..dba22fd0113 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -12033,10 +12033,15 @@ glusterd_remove_auxiliary_mount (char *volname) GLUSTERD_GET_QUOTA_AUX_MOUNT_PATH (mountdir, volname, "/"); ret = gf_umount_lazy (this->name, mountdir, 1); - if (ret) + if (ret) { gf_log (this->name, GF_LOG_ERROR, "umount on %s failed, " "reason : %s", mountdir, strerror (errno)); + /* Hide EBADF as it means the mount is already gone */ + if (errno == EBADF) + ret = 0; + } + return ret; } -- cgit