summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorBasavanagowda Kanur <gowda@gluster.com>2009-02-19 19:38:57 +0530
committerAnand V. Avati <avati@dev.gluster.com>2009-02-19 07:08:12 -0800
commit91df2dbcb10813d17053f715ae40a50b7499f4bc (patch)
tree510b3d59833b01372132f9d8024d6f70ba0fad50 /xlators
parented1d91986cdaf0240b4e6a8c920f17b7f2d6d57b (diff)
cluster/ha to handle EBADFD for fd based operations as transport disconnected.
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/cluster/ha/src/ha-helpers.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/xlators/cluster/ha/src/ha-helpers.c b/xlators/cluster/ha/src/ha-helpers.c
index 8193caf27..a88adad97 100644
--- a/xlators/cluster/ha/src/ha-helpers.c
+++ b/xlators/cluster/ha/src/ha-helpers.c
@@ -24,6 +24,9 @@
#include "compat-errno.h"
#include "ha.h"
+#define HA_TRANSPORT_NOTCONN(_ret, _errno, _fd) \
+ ((_ret == -1) && (_fd ? (_errno == EBADFD):(_errno == ENOTCONN)))
+
int ha_alloc_init_fd (call_frame_t *frame, fd_t *fd)
{
ha_local_t *local = NULL;
@@ -111,7 +114,8 @@ int ha_handle_cbk (call_frame_t *frame, void *cookie, int op_ret, int op_errno)
gf_log (xl->name, GF_LOG_ERROR ,"(child=%s) (op_ret=%d op_errno=%s)",
children[prev_child]->name, op_ret, strerror (op_errno));
}
- if (op_ret == -1 && (op_errno == ENOTCONN)) {
+
+ if (HA_TRANSPORT_NOTCONN (op_ret, op_errno, (local->fd))) {
ret = 0;
if (local->fd) {
ret = fd_ctx_get (local->fd, xl, &tmp_hafdp);