diff options
author | Krutika Dhananjay <kdhananj@redhat.com> | 2016-12-28 14:32:12 +0530 |
---|---|---|
committer | Niels de Vos <ndevos@redhat.com> | 2017-01-11 00:39:34 -0800 |
commit | bdb7f9d2c8fdca9c5874a2569250de7b6a68fa57 (patch) | |
tree | e120465613e68ca7d12c271290652369cadd16c7 | |
parent | 068e4f345f51438d252b1e330ca7049bd4a67e03 (diff) |
mount/fuse: Fix the place where graph-switch event is logged
Backport of: http://review.gluster.org/16302
fuse-bridge changes the active subvol in fuse_graph_sync(), and not in
fuse_graph_setup(). This patch is written to get more accurate timestamp
in the logs as to when a graph switch actually happened and in the hope
that this will help better in identifying the issue of VM corruption
that users are seeing when they add-bricks.
Change-Id: I3c8577b87db02a2a6ce6159e7d04cf58a2bda0c1
BUG: 1411613
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: http://review.gluster.org/16366
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Smoke: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
-rw-r--r-- | xlators/mount/fuse/src/fuse-bridge.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c index eead33fbd55..525a6a6fbbc 100644 --- a/xlators/mount/fuse/src/fuse-bridge.c +++ b/xlators/mount/fuse/src/fuse-bridge.c @@ -4802,6 +4802,7 @@ fuse_graph_sync (xlator_t *this) fuse_private_t *priv = NULL; int need_first_lookup = 0; int ret = 0; + int new_graph_id = 0; xlator_t *old_subvol = NULL, *new_subvol = NULL; uint64_t winds_on_old_subvol = 0; @@ -4814,6 +4815,7 @@ fuse_graph_sync (xlator_t *this) old_subvol = priv->active_subvol; new_subvol = priv->active_subvol = priv->next_graph->top; + new_graph_id = priv->next_graph->id; priv->next_graph = NULL; need_first_lookup = 1; @@ -4832,6 +4834,8 @@ unlock: pthread_mutex_unlock (&priv->sync_mutex); if (need_first_lookup) { + gf_log ("fuse", GF_LOG_INFO, "switched to graph %d", + new_graph_id); fuse_first_lookup (this); } @@ -5237,9 +5241,6 @@ fuse_graph_setup (xlator_t *this, glusterfs_graph_t *graph) prev_graph->top, NULL); } - gf_log ("fuse", GF_LOG_INFO, "switched to graph %d", - ((graph) ? graph->id : 0)); - return ret; unlock: pthread_mutex_unlock (&priv->sync_mutex); |