From dab12ce093628860bf43c3e0c7eaf9099cf7a78f Mon Sep 17 00:00:00 2001 From: Mohit Agrawal Date: Sat, 30 Jun 2018 19:51:34 +0530 Subject: glusterfs: Brick process is crash at the time of call server_first_lookup Problem: Brick process is getting crash while executing test case tests/bugs/core/bug-1432542-mpx-restart-crash.t Solution: At the time of initiating connection with brick process by client brick process call server_setvolume.If cleanup thread has set cleanup_starting flag after check flag by server_setvolume then a brick process can crash at the time of calling lookup on brick root.To avoid crash check cleanup_starting flag before just call server_first_lookup BUG: 1597627 Change-Id: I12542c124c76429184df34a04c1eae1a30052ca7 fixes: bz#1597627 Signed-off-by: Mohit Agrawal Note: To test the patch executing test case tests/bugs/core/bug-1432542-mpx-restart-crash.t in a loop around 100 times --- xlators/protocol/server/src/server-handshake.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'xlators/protocol/server/src/server-handshake.c') diff --git a/xlators/protocol/server/src/server-handshake.c b/xlators/protocol/server/src/server-handshake.c index ca167ce2dfa..494eafe72ea 100644 --- a/xlators/protocol/server/src/server-handshake.c +++ b/xlators/protocol/server/src/server-handshake.c @@ -883,9 +883,17 @@ fail: to client. Very important in case of subdirectory mounts, where if client is trying to mount a non-existing directory */ if (op_ret >= 0 && client->bound_xl->itable) { - op_ret = server_first_lookup (this, client, reply); - if (op_ret == -1) - op_errno = ENOENT; + if (client->bound_xl->cleanup_starting) { + op_ret = -1; + op_errno = EAGAIN; + ret = dict_set_str (reply, "ERROR", + "cleanup flag is set for xlator " + "before call first_lookup Try again later"); + } else { + op_ret = server_first_lookup (this, client, reply); + if (op_ret == -1) + op_errno = ENOENT; + } } rsp = GF_CALLOC (1, sizeof (gf_setvolume_rsp), -- cgit