From 6eb419f1ca68f536a700e63c1521e428560a0d9d Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Fri, 3 Apr 2009 06:30:54 -0700 Subject: server-protocol - reimplement connection cleanup to happen in 2 phases - first phase, which happens when POLLERR is received on transport, releases all locks, flushes all open fds. - second phase, which happens when both the transports of connection destroyed, destroys the containers like lock table, fd table along with the connection. - the first phase, clears up any references to transport held by translators like posix-locks(in the form of blocked locks) paving way for the second phase. Signed-off-by: Anand V. Avati --- xlators/protocol/server/src/server-protocol.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'xlators/protocol/server/src/server-protocol.c') diff --git a/xlators/protocol/server/src/server-protocol.c b/xlators/protocol/server/src/server-protocol.c index 1153a545100..5eee27b9239 100644 --- a/xlators/protocol/server/src/server-protocol.c +++ b/xlators/protocol/server/src/server-protocol.c @@ -4286,27 +4286,15 @@ server_release (call_frame_t *frame, xlator_t *bound_xl, state = CALL_STATE(frame); state->fd_no = ntoh64 (req->fd); - state->fd = gf_fd_fdptr_get (conn->fdtable, - state->fd_no); - - GF_VALIDATE_OR_GOTO(bound_xl->name, state->fd, fail); gf_fd_put (conn->fdtable, state->fd_no); gf_log (bound_xl->name, GF_LOG_DEBUG, - "%"PRId64": RELEASE \'fd=%"PRId64" (%"PRId64")\'", - frame->root->unique, state->fd_no, state->fd->inode->ino); + "%"PRId64": RELEASE \'fd=%"PRId64"\'", + frame->root->unique, state->fd_no); - STACK_WIND (frame, - server_release_cbk, - BOUND_XL(frame), - BOUND_XL(frame)->fops->flush, - state->fd); - return 0; -fail: - server_release_cbk (frame, NULL, frame->this, - -1, EINVAL); + server_release_cbk (frame, NULL, frame->this, 0, 0); return 0; } @@ -8269,6 +8257,7 @@ notify (xlator_t *this, int32_t event, void *data, ...) ret = -1; transport_disconnect (trans); + server_connection_cleanup (this, trans->xl_private); } break; -- cgit