From dfa08fe05843b5da077ddbe059d744ce3864044e Mon Sep 17 00:00:00 2001 From: Krishnan Parthasarathi Date: Wed, 16 Oct 2013 00:56:01 +0530 Subject: gfapi: fix return value of glfs_fini Change-Id: I5b90c7602334226a978bbdae2f9516e8701b403f BUG: 1004519 Signed-off-by: Krishnan Parthasarathi Reviewed-on: http://review.gluster.org/6092 Reviewed-by: Shyamsundar Ranganathan Tested-by: Gluster Build System Reviewed-by: Anand Avati --- api/src/glfs.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'api') diff --git a/api/src/glfs.c b/api/src/glfs.c index 2f58b6185..246601188 100644 --- a/api/src/glfs.c +++ b/api/src/glfs.c @@ -617,11 +617,11 @@ glfs_init (struct glfs *fs) int glfs_fini (struct glfs *fs) { - int ret = -1; - xlator_t *subvol = NULL; + int ret = -1; + int countdown = 100; + xlator_t *subvol = NULL; glusterfs_ctx_t *ctx = NULL; - call_pool_t *call_pool = NULL; - int countdown = 100; + call_pool_t *call_pool = NULL; ctx = fs->ctx; @@ -642,6 +642,10 @@ glfs_fini (struct glfs *fs) } /* leaked frames may exist, we ignore */ + /*We deem glfs_fini as successful if there are no pending frames in the call + *pool*/ + ret = (call_pool->cnt == 0)? 0: -1; + subvol = glfs_active_subvol (fs); if (subvol) { /* PARENT_DOWN within glfs_subvol_done() is issued only -- cgit