summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/client/src/client.h
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/protocol/client/src/client.h')
-rw-r--r--xlators/protocol/client/src/client.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/xlators/protocol/client/src/client.h b/xlators/protocol/client/src/client.h
index 00b743a3c70..2dda451c9cb 100644
--- a/xlators/protocol/client/src/client.h
+++ b/xlators/protocol/client/src/client.h
@@ -35,7 +35,7 @@
#define CLIENT_CMD_DISCONNECT "trusted.glusterfs.client-disconnect"
#define CLIENT_DUMP_LOCKS "trusted.glusterfs.clientlk-dump"
-#define CLIENT_GET_REMOTE_FD(conf, fd, remote_fd, label) \
+#define CLIENT_GET_REMOTE_FD(conf, fd, remote_fd, op_errno, label) \
do { \
clnt_fd_ctx_t *fdctx = NULL; \
pthread_mutex_lock (&conf->lock); \
@@ -48,6 +48,13 @@
} else { \
remote_fd = fdctx->remote_fd; \
} \
+ if (remote_fd == -1) { \
+ gf_log (THIS->name, GF_LOG_WARNING, " (%s) " \
+ "remote_fd is -1. EBADFD", \
+ uuid_utoa (fd->inode->gfid)); \
+ op_errno = EBADFD; \
+ goto label; \
+ } \
} while (0);
struct clnt_options {