|
|
d1681e |
From 7dd1fe266d8c908e8196c93fc371cf205a3d57cb Mon Sep 17 00:00:00 2001
|
|
|
d1681e |
From: Amar Tumballi <amarts@redhat.com>
|
|
|
d1681e |
Date: Sun, 4 Feb 2018 10:04:29 +0530
|
|
|
d1681e |
Subject: [PATCH 143/148] glusterd/store: handle the case of fsid being set to
|
|
|
d1681e |
0
|
|
|
d1681e |
|
|
|
d1681e |
Generally this would happen when a system gets upgraded from an
|
|
|
d1681e |
version which doesn't have fsid details, to a version with fsid
|
|
|
d1681e |
values. Without this change, after upgrade, people would see reduced
|
|
|
d1681e |
'df ' output, causing lot of confusions.
|
|
|
d1681e |
|
|
|
d1681e |
Debugging Credits: Nithya B <nbalacha@redhat.com>
|
|
|
d1681e |
|
|
|
d1681e |
>upstream mainline patch : https://review.gluster.org/#/c/19484/
|
|
|
d1681e |
|
|
|
d1681e |
Change-Id: Id718127ddfb69553b32770b25021290bd0e7c49a
|
|
|
d1681e |
BUG: 1541830
|
|
|
d1681e |
Signed-off-by: Amar Tumballi <amarts@redhat.com>
|
|
|
d1681e |
Reviewed-on: https://code.engineering.redhat.com/gerrit/129739
|
|
|
d1681e |
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
|
|
d1681e |
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
|
|
d1681e |
---
|
|
|
d1681e |
xlators/mgmt/glusterd/src/glusterd-store.c | 19 +++++++++++++++++++
|
|
|
d1681e |
1 file changed, 19 insertions(+)
|
|
|
d1681e |
|
|
|
d1681e |
diff --git a/xlators/mgmt/glusterd/src/glusterd-store.c b/xlators/mgmt/glusterd/src/glusterd-store.c
|
|
|
d1681e |
index e35fcde..6bb7372 100644
|
|
|
d1681e |
--- a/xlators/mgmt/glusterd/src/glusterd-store.c
|
|
|
d1681e |
+++ b/xlators/mgmt/glusterd/src/glusterd-store.c
|
|
|
d1681e |
@@ -2632,6 +2632,25 @@ glusterd_store_retrieve_bricks (glusterd_volinfo_t *volinfo)
|
|
|
d1681e |
strlen(abspath));
|
|
|
d1681e |
}
|
|
|
d1681e |
}
|
|
|
d1681e |
+
|
|
|
d1681e |
+ /* Handle upgrade case of shared_brick_count 'fsid' */
|
|
|
d1681e |
+ /* Ideally statfs_fsid should never be 0 if done right */
|
|
|
d1681e |
+ if (!gf_uuid_compare(brickinfo->uuid, MY_UUID) &&
|
|
|
d1681e |
+ brickinfo->statfs_fsid == 0) {
|
|
|
d1681e |
+ struct statvfs brickstat = {0,};
|
|
|
d1681e |
+ ret = sys_statvfs (brickinfo->path, &brickstat);
|
|
|
d1681e |
+ if (ret) {
|
|
|
d1681e |
+ gf_msg (this->name, GF_LOG_WARNING,
|
|
|
d1681e |
+ errno,
|
|
|
d1681e |
+ GD_MSG_BRICKINFO_CREATE_FAIL,
|
|
|
d1681e |
+ "failed to get statfs() call on brick %s",
|
|
|
d1681e |
+ brickinfo->path);
|
|
|
d1681e |
+ /* No need for treating it as an error, lets continue
|
|
|
d1681e |
+ with just a message */
|
|
|
d1681e |
+ }
|
|
|
d1681e |
+ brickinfo->statfs_fsid = brickstat.f_fsid;
|
|
|
d1681e |
+ }
|
|
|
d1681e |
+
|
|
|
d1681e |
cds_list_add_tail (&brickinfo->brick_list, &volinfo->bricks);
|
|
|
d1681e |
brick_count++;
|
|
|
d1681e |
}
|
|
|
d1681e |
--
|
|
|
d1681e |
1.8.3.1
|
|
|
d1681e |
|