From 1f3a0dd4742a2fcd3215aee4a5e22125d7ea4f4d Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Wed, 4 Apr 2012 18:04:52 +0530 Subject: fuse-bridge/fd-migration: document migration failures in fdctx. Change-Id: Ib85871e586f89f88dd7bf738fbb284b5d7b70a86 BUG: 809919 Signed-off-by: Raghavendra G Reviewed-on: http://review.gluster.com/3085 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- xlators/mount/fuse/src/fuse-resolve.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'xlators/mount/fuse/src/fuse-resolve.c') diff --git a/xlators/mount/fuse/src/fuse-resolve.c b/xlators/mount/fuse/src/fuse-resolve.c index 94a825e3d..abb11dbb1 100644 --- a/xlators/mount/fuse/src/fuse-resolve.c +++ b/xlators/mount/fuse/src/fuse-resolve.c @@ -31,6 +31,8 @@ int fuse_resolve_continue (fuse_state_t *state); int fuse_resolve_entry_simple (fuse_state_t *state); int fuse_resolve_inode_simple (fuse_state_t *state); +fuse_fd_ctx_t * +fuse_fd_ctx_get (xlator_t *this, fd_t *fd); static int fuse_resolve_loc_touchup (fuse_state_t *state) @@ -330,9 +332,10 @@ fuse_resolve_inode (fuse_state_t *state) static int fuse_resolve_fd (fuse_state_t *state) { - fuse_resolve_t *resolve = NULL; - fd_t *fd = NULL; - xlator_t *active_subvol = NULL; + fuse_resolve_t *resolve = NULL; + fd_t *fd = NULL; + xlator_t *active_subvol = NULL; + fuse_fd_ctx_t *fdctx = NULL; resolve = state->resolve_now; @@ -342,6 +345,17 @@ fuse_resolve_fd (fuse_state_t *state) if (state->active_subvol != active_subvol) { resolve->op_ret = -1; resolve->op_errno = EBADF; + } + + fdctx = fuse_fd_ctx_get (state->this, fd); + if (fdctx != NULL) { + if (fdctx->migration_failed) { + resolve->op_ret = -1; + resolve->op_errno = EBADF; + } + } + + if ((resolve->op_ret == -1) && (resolve->op_errno == EBADF)) { gf_log ("fuse-resolve", GF_LOG_WARNING, "migration of fd (%p) " "did not complete, failing fop with EBADF", fd); } -- cgit