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
This commit is contained in:
Mohit Agrawal 2018-06-30 19:51:34 +05:30 committed by Amar Tumballi
parent 10b0d73003
commit dab12ce093

View File

@ -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),