diff options
| -rw-r--r-- | tests/bugs/glusterd/df-results-post-replace-brick-operations.t | 3 | ||||
| -rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 14 | 
2 files changed, 11 insertions, 6 deletions
diff --git a/tests/bugs/glusterd/df-results-post-replace-brick-operations.t b/tests/bugs/glusterd/df-results-post-replace-brick-operations.t index 443911ceed4..04f75889388 100644 --- a/tests/bugs/glusterd/df-results-post-replace-brick-operations.t +++ b/tests/bugs/glusterd/df-results-post-replace-brick-operations.t @@ -53,6 +53,9 @@ total_space=$(df -P $M0 | tail -1 | awk '{ print $2}')  TEST $CLI volume replace-brick $V0 $H0:$B0/${V0}1/brick1 $H0:$B0/${V0}4/brick1 commit force  TEST $CLI volume replace-brick $V0 $H0:$B0/${V0}2/brick1 $H0:$B0/${V0}5/brick1 commit force +EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" afr_child_up_status $V0 0 +EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" afr_child_up_status $V0 1 +  # check for the size at mount point, it should be same as previous  total_space_new=$(df -P $M0 | tail -1 | awk '{ print $2}')  TEST [ $total_space -eq $total_space_new ] diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 7b8369f623b..7687a8b9d67 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -2833,7 +2833,7 @@ glusterd_volume_compute_cksum(glusterd_volinfo_t *volinfo, char *cksum_path,      *cs = cksum;  out: -    if (fd > 0) +    if (fd != -1)          sys_close(fd);      if (unlink_sortfile)          sys_unlink(sort_filepath); @@ -3761,7 +3761,8 @@ glusterd_import_new_brick(dict_t *peer_data, int32_t vol_count,      }      new_brickinfo->decommissioned = decommissioned;      if (brick_id) -        strcpy(new_brickinfo->brick_id, brick_id); +        gf_strncpy(new_brickinfo->brick_id, brick_id, +                   sizeof(new_brickinfo->brick_id));      snprintf(key, sizeof(key), "%s%d.brick%d", prefix, vol_count, brick_count);      ret = gd_import_new_brick_snap_details(peer_data, key, new_brickinfo); @@ -8436,9 +8437,9 @@ glusterd_brick_signal(glusterd_volinfo_t *volinfo,      kill(pid, sig);      sleep(1); +    sys_unlink(dumpoptions_path);      ret = 0;  out: -    sys_unlink(dumpoptions_path);      if (pidfile)          fclose(pidfile);      return ret; @@ -8533,11 +8534,11 @@ glusterd_nfs_statedump(char *options, int option_cnt, char **op_errstr)      sleep(1); +    sys_unlink(dumpoptions_path);      ret = 0;  out:      if (pidfile)          fclose(pidfile); -    sys_unlink(dumpoptions_path);      GF_FREE(dup_options);      return ret;  } @@ -8658,11 +8659,11 @@ glusterd_quotad_statedump(char *options, int option_cnt, char **op_errstr)      sleep(1); +    sys_unlink(dumpoptions_path);      ret = 0;  out:      if (pidfile)          fclose(pidfile); -    sys_unlink(dumpoptions_path);      GF_FREE(dup_options);      return ret;  } @@ -12881,7 +12882,8 @@ glusterd_update_mntopts(char *brick_path, glusterd_brickinfo_t *brickinfo)          ret = -1;          goto out;      } -    strcpy(brickinfo->mnt_opts, entry->mnt_opts); +    gf_strncpy(brickinfo->mnt_opts, entry->mnt_opts, +               sizeof(brickinfo->mnt_opts));      ret = 0;  out:  | 
