diff options
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-jarvis-handler.c')
| -rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-jarvis-handler.c | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-jarvis-handler.c b/xlators/mgmt/glusterd/src/glusterd-jarvis-handler.c index f07b54ac6..0e1961e7c 100644 --- a/xlators/mgmt/glusterd/src/glusterd-jarvis-handler.c +++ b/xlators/mgmt/glusterd/src/glusterd-jarvis-handler.c @@ -98,19 +98,21 @@ glusterd_handle_vol_lock_fn (rpcsvc_request_t *req) } ret = dict_get_str (dict, "volname", &volname); - if (ret) - gf_log (this->name, GF_LOG_ERROR, - "Unable to acquire volname"); - else { - ret = glusterd_volume_lock (volname, lock_req.uuid); + if (ret) { + /* Trying to acquire volume locks on multiple volumes */ + ret = glusterd_multiple_volumes_lock (dict, MY_UUID); + if (ret) + gf_log ("", GF_LOG_ERROR, + "Failed to acquire volume locks on localhost"); + } else { + ret = glusterd_volume_lock (volname, MY_UUID); if (ret) gf_log (this->name, GF_LOG_ERROR, - "Unable to acquire lock for %s", - volname); - - glusterd_jarvis_vol_lock_send_resp (req, ret); + "Unable to acquire local lock for %s", volname); } + glusterd_jarvis_vol_lock_send_resp (req, ret); + out: if (dict) dict_unref (dict); @@ -688,19 +690,21 @@ glusterd_handle_vol_unlock_fn (rpcsvc_request_t *req) } ret = dict_get_str (dict, "volname", &volname); - if (ret) - gf_log (this->name, GF_LOG_ERROR, - "Unable to acquire volname"); - else { - ret = glusterd_volume_unlock (volname, unlock_req.uuid); + if (ret) { + /* Trying to release volume locks on multiple volumes */ + ret = glusterd_multiple_volumes_unlock (dict, MY_UUID); + if (ret) + gf_log ("", GF_LOG_ERROR, + "Failed to release volume locks on localhost"); + } else { + ret = glusterd_volume_unlock (volname, MY_UUID); if (ret) gf_log (this->name, GF_LOG_ERROR, - "Unable to release lock for %s", - volname); - - glusterd_jarvis_vol_unlock_send_resp (req, ret); + "Unable to acquire local lock for %s", volname); } + glusterd_jarvis_vol_unlock_send_resp (req, ret); + out: if (dict) dict_unref (dict); |
