summaryrefslogtreecommitdiffstats
path: root/xlators/mount/fuse/src/fuse-resolve.c
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@gluster.com>2012-04-04 18:04:52 +0530
committerAnand Avati <avati@redhat.com>2012-04-04 16:27:45 -0700
commit1f3a0dd4742a2fcd3215aee4a5e22125d7ea4f4d (patch)
tree00976725b971f04410920726b3e2a8f39e2710ff /xlators/mount/fuse/src/fuse-resolve.c
parent42a0889d93450e6f1f3472ec0818e678412346c2 (diff)
fuse-bridge/fd-migration: document migration failures in fdctx.
Change-Id: Ib85871e586f89f88dd7bf738fbb284b5d7b70a86 BUG: 809919 Signed-off-by: Raghavendra G <raghavendra@gluster.com> Reviewed-on: http://review.gluster.com/3085 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators/mount/fuse/src/fuse-resolve.c')
-rw-r--r--xlators/mount/fuse/src/fuse-resolve.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/xlators/mount/fuse/src/fuse-resolve.c b/xlators/mount/fuse/src/fuse-resolve.c
index 94a825e3d24..abb11dbb1d9 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);
}