summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmar Tumballi <amarts@redhat.com>2018-02-04 10:04:29 +0530
committerAtin Mukherjee <amukherj@redhat.com>2018-02-05 04:36:21 +0000
commite7ee4d8949b015a1421d4d97b763ccb4dcfc6eb1 (patch)
tree2269d726ada08340ddf3d2f6151ac608418194d2
parentec2c95f310fdd30531b04f85840860aae2c8dff4 (diff)
glusterd/store: handle the case of fsid being set to 0
Generally this would happen when a system gets upgraded from an version which doesn't have fsid details, to a version with fsid values. Without this change, after upgrade, people would see reduced 'df ' output, causing lot of confusions. Debugging Credits: Nithya B <nbalacha@redhat.com> Change-Id: Id718127ddfb69553b32770b25021290bd0e7c49a BUG: 1517260 Signed-off-by: Amar Tumballi <amarts@redhat.com>
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-store.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-store.c b/xlators/mgmt/glusterd/src/glusterd-store.c
index af5044fb992..f07e5fa315e 100644
--- a/xlators/mgmt/glusterd/src/glusterd-store.c
+++ b/xlators/mgmt/glusterd/src/glusterd-store.c
@@ -2627,6 +2627,25 @@ glusterd_store_retrieve_bricks (glusterd_volinfo_t *volinfo)
strlen(abspath));
}
}
+
+ /* Handle upgrade case of shared_brick_count 'fsid' */
+ /* Ideally statfs_fsid should never be 0 if done right */
+ if (!gf_uuid_compare(brickinfo->uuid, MY_UUID) &&
+ brickinfo->statfs_fsid == 0) {
+ struct statvfs brickstat = {0,};
+ ret = sys_statvfs (brickinfo->path, &brickstat);
+ if (ret) {
+ gf_msg (this->name, GF_LOG_WARNING,
+ errno,
+ GD_MSG_BRICKINFO_CREATE_FAIL,
+ "failed to get statfs() call on brick %s",
+ brickinfo->path);
+ /* No need for treating it as an error, lets continue
+ with just a message */
+ }
+ brickinfo->statfs_fsid = brickstat.f_fsid;
+ }
+
cds_list_add_tail (&brickinfo->brick_list, &volinfo->bricks);
brick_count++;
}