summaryrefslogtreecommitdiffstats
path: root/xlators/mount/fuse/src/fuse-resolve.c
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@gluster.com>2012-02-08 15:06:30 +0530
committerVijay Bellur <vijay@gluster.com>2012-02-21 01:05:14 -0800
commit7197111677619da96c80572a09331d6e28c1015b (patch)
tree4ebe916f4aa9b4bd34ab23a1c6ec145fd60c3b27 /xlators/mount/fuse/src/fuse-resolve.c
parent6d19136de7af9135dd23662f18c3ee544a2888da (diff)
fuse-bridge: Handle graph-switch.
The purpose of this patch is to let protocol/client know when its transports can be disconnected, without application running on gluster mount noticing any effects of graph switch. In order to do this, we migrate all fds and blocked locks to new graph. Once this migration is complete and there are no in-transit frames as viewed by fuse-bridge, we send a PARENT_DOWN event to its children. protocol/client on receiving this event, can disconnect up its transports. Change-Id: Idcea4bc43e23fb077ac16538b61335ebad84ba16 BUG: 767862 Reviewed-on: http://review.gluster.com/2734 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators/mount/fuse/src/fuse-resolve.c')
-rw-r--r--xlators/mount/fuse/src/fuse-resolve.c38
1 files changed, 18 insertions, 20 deletions
diff --git a/xlators/mount/fuse/src/fuse-resolve.c b/xlators/mount/fuse/src/fuse-resolve.c
index 1af80b93c57..5a09ea0d3e9 100644
--- a/xlators/mount/fuse/src/fuse-resolve.c
+++ b/xlators/mount/fuse/src/fuse-resolve.c
@@ -80,11 +80,13 @@ fuse_resolve_entry_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
STACK_DESTROY (frame->root);
if (op_ret == -1) {
- gf_log (this->name, ((op_errno == ENOENT) ? GF_LOG_DEBUG :
- GF_LOG_WARNING),
+ gf_log (this->name, (op_errno == ENOENT)
+ ? GF_LOG_DEBUG : GF_LOG_WARNING,
"%s/%s: failed to resolve (%s)",
uuid_utoa (resolve_loc->pargfid), resolve_loc->name,
strerror (op_errno));
+ resolve->op_ret = -1;
+ resolve->op_errno = op_errno;
goto out;
}
@@ -141,12 +143,14 @@ fuse_resolve_gfid_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
STACK_DESTROY (frame->root);
if (op_ret == -1) {
- gf_log (this->name, ((op_errno == ENOENT) ? GF_LOG_DEBUG :
- GF_LOG_WARNING),
+ gf_log (this->name, (op_errno == ENOENT)
+ ? GF_LOG_DEBUG : GF_LOG_WARNING,
"%s: failed to resolve (%s)",
uuid_utoa (resolve->resolve_loc.gfid),
strerror (op_errno));
loc_wipe (&resolve->resolve_loc);
+ resolve->op_ret = -1;
+ resolve->op_errno = op_errno;
goto out;
}
@@ -163,6 +167,7 @@ fuse_resolve_gfid_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
}
loc_now->parent = link_inode;
+ uuid_copy (loc_now->pargfid, link_inode->gfid);
fuse_resolve_entry (state);
@@ -237,13 +242,12 @@ fuse_resolve_parent_simple (fuse_state_t *state)
parent = inode_find (state->itable, resolve->pargfid);
if (!parent) {
- resolve->op_ret = -1;
- resolve->op_errno = ENOENT;
/* non decisive result - parent missing */
return 1;
}
loc->parent = parent;
+ uuid_copy (loc->pargfid, resolve->pargfid);
inode = inode_grep (state->itable, parent, loc->name);
if (inode) {
@@ -261,9 +265,6 @@ int
fuse_resolve_parent (fuse_state_t *state)
{
int ret = 0;
- loc_t *loc = NULL;
-
- loc = state->loc_now;
ret = fuse_resolve_parent_simple (state);
if (ret > 0) {
@@ -302,9 +303,6 @@ fuse_resolve_inode_simple (fuse_state_t *state)
if (inode)
goto found;
- resolve->op_ret = -1;
- resolve->op_errno = ENOENT;
-
return 1;
found:
loc->inode = inode;
@@ -316,9 +314,6 @@ int
fuse_resolve_inode (fuse_state_t *state)
{
int ret = 0;
- loc_t *loc = NULL;
-
- loc = state->loc_now;
ret = fuse_resolve_inode_simple (state);
@@ -344,7 +339,14 @@ fuse_resolve_fd (fuse_state_t *state)
fd = resolve->fd;
active_subvol = fd->inode->table->xl;
- state->active_subvol = active_subvol;
+ if (state->active_subvol != active_subvol) {
+ 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);
+ }
+
+ /* state->active_subvol = active_subvol; */
fuse_resolve_continue (state);
@@ -434,10 +436,6 @@ fuse_resolve (fuse_state_t *state)
fuse_resolve_inode (state);
} else {
-
- resolve->op_ret = 0;
- resolve->op_errno = EINVAL;
-
fuse_resolve_all (state);
}