diff options
author | Vijay Bellur <vijay@gluster.com> | 2010-09-28 09:29:52 +0000 |
---|---|---|
committer | Vijay Bellur <vijay@dev.gluster.com> | 2010-09-28 09:05:05 -0700 |
commit | 981970098a68ae222805ae77a0ea53eb1f95fd21 (patch) | |
tree | b61afa510f90a8de28bfe7c56147e97c3d5a0407 /xlators | |
parent | d7e694ad7049cd819f8dbc26ec1e7d35b4d1a6fe (diff) |
mgmt/glusterd: compute cksum upon volume retrieval
Signed-off-by: Vijay Bellur <vijay@gluster.com>
Signed-off-by: Vijay Bellur <vijay@dev.gluster.com>
BUG: 971 (dynamic volume management)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=971
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-store.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-store.c b/xlators/mgmt/glusterd/src/glusterd-store.c index 14e55c56450..27bed10d21f 100644 --- a/xlators/mgmt/glusterd/src/glusterd-store.c +++ b/xlators/mgmt/glusterd/src/glusterd-store.c @@ -161,9 +161,9 @@ glusterd_store_create_brick (glusterd_volinfo_t *volinfo, snprintf (tmpbuf, sizeof (tmpbuf), "%s:%s", brickinfo->hostname, tmppath); ret = glusterd_store_save_value (volinfo->shandle, buf, tmpbuf); - + GF_FREE (tmppath); - + out: if (shandle->fd > 0) { close (shandle->fd); @@ -351,7 +351,7 @@ glusterd_store_create_volume (glusterd_volinfo_t *volinfo) goto out; list_for_each_entry (brickinfo, &volinfo->bricks, brick_list) { - ret = glusterd_store_create_brick (volinfo, brickinfo, + ret = glusterd_store_create_brick (volinfo, brickinfo, brick_count); if (ret) goto out; @@ -894,14 +894,13 @@ glusterd_store_retrieve_bricks (glusterd_volinfo_t *volinfo) if (ret) goto out; - snprintf (tmpkey, sizeof (tmpkey), "%s-%d", - GLUSTERD_STORE_KEY_VOL_BRICK,brick_count); - ret = glusterd_store_iter_get_matching (tmpiter, tmpkey, + GLUSTERD_STORE_KEY_VOL_BRICK,brick_count); + ret = glusterd_store_iter_get_matching (tmpiter, tmpkey, &tmpvalue); snprintf (path, sizeof (path), "%s/%s", brickdir, tmpvalue); - GF_FREE (tmpvalue); + GF_FREE (tmpvalue); tmpvalue = NULL; @@ -1044,6 +1043,12 @@ glusterd_store_retrieve_volume (char *volname) goto out; ret = glusterd_store_retrieve_bricks (volinfo); + if (ret) + goto out; + + ret = glusterd_volume_compute_cksum (volinfo); + if (ret) + goto out; list_add_tail (&volinfo->vol_list, &priv->volumes); |