diff options
author | Avra Sengupta <asengupt@redhat.com> | 2014-05-05 23:27:28 +0000 |
---|---|---|
committer | Kaushal M <kaushal@redhat.com> | 2014-05-15 00:30:19 -0700 |
commit | d1bf6eebb8da61aa22530a91ee168725efefe0bd (patch) | |
tree | ec78c4c1b610592136295861f67b854a875a15b9 /xlators/mgmt/glusterd/src/glusterd-store.c | |
parent | eb04dab9992f8f5d4b2d45e1ca10032fededcff1 (diff) |
glusterd: Differentiate snap-volume directories properly.
If /var/lib/glusterd is hosted on xfs system, the entry->d_type
not showing the correct d_type owes to the restore path prematurely
exiting. Hence checking entry->d_name to differntiate <snap-name>/info
file, missed_snaps_list file and the <snap-name>/geo-replication
directory, from the actual volume directories, without impacting
the gluster volumes.
Change-Id: I9a774a845282fe7cc697e37bbcf7c4545aee7678
BUG: 1094557
Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-on: http://review.gluster.org/7680
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Sachin Pandit <spandit@redhat.com>
Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-by: Kaushal M <kaushal@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-store.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-store.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-store.c b/xlators/mgmt/glusterd/src/glusterd-store.c index ca6d9454826..c5fdc805bb1 100644 --- a/xlators/mgmt/glusterd/src/glusterd-store.c +++ b/xlators/mgmt/glusterd/src/glusterd-store.c @@ -2792,9 +2792,8 @@ glusterd_store_retrieve_volumes (xlator_t *this, glusterd_snap_t *snap) glusterd_for_each_entry (entry, dir); while (entry) { - if ( entry->d_type != DT_DIR || - (strcmp (entry->d_name, "geo-replication") == 0 - && snap)) + if (snap && ((!strcmp (entry->d_name, "geo-replication")) || + (!strcmp (entry->d_name, "info")))) goto next; volinfo = glusterd_store_retrieve_volume (entry->d_name, snap); @@ -3329,7 +3328,7 @@ glusterd_store_retrieve_snaps (xlator_t *this) glusterd_for_each_entry (entry, dir); while (entry) { - if (entry->d_type == DT_DIR) { + if (strcmp (entry->d_name, GLUSTERD_MISSED_SNAPS_LIST_FILE)) { ret = glusterd_store_retrieve_snap (entry->d_name); if (ret) { gf_log (this->name, GF_LOG_ERROR, |