From d1bf6eebb8da61aa22530a91ee168725efefe0bd Mon Sep 17 00:00:00 2001 From: Avra Sengupta Date: Mon, 5 May 2014 23:27:28 +0000 Subject: 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 /info file, missed_snaps_list file and the /geo-replication directory, from the actual volume directories, without impacting the gluster volumes. Change-Id: I9a774a845282fe7cc697e37bbcf7c4545aee7678 BUG: 1094557 Signed-off-by: Avra Sengupta Reviewed-on: http://review.gluster.org/7680 Tested-by: Gluster Build System Reviewed-by: Sachin Pandit Reviewed-by: Krutika Dhananjay Reviewed-by: Kaushal M --- xlators/mgmt/glusterd/src/glusterd-store.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'xlators/mgmt/glusterd/src/glusterd-store.c') 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, -- cgit