summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorMohit Agrawal <moagrawa@redhat.com>2018-06-30 19:51:34 +0530
committerAmar Tumballi <amarts@redhat.com>2018-07-09 03:22:49 +0000
commitdab12ce093628860bf43c3e0c7eaf9099cf7a78f (patch)
tree7843069ab82446927d85c7d6521ee048cf005ff7 /xlators
parent10b0d7300336fbe97bf2341b46203d50958ee5a1 (diff)
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 <moagrawa@redhat.com> Note: To test the patch executing test case tests/bugs/core/bug-1432542-mpx-restart-crash.t in a loop around 100 times
Diffstat (limited to 'xlators')
-rw-r--r--xlators/protocol/server/src/server-handshake.c14
1 files changed, 11 insertions, 3 deletions
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),