From e71119e942eb016ba5a11c3f986715f16da10b82 Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Thu, 10 Nov 2016 10:56:26 +0530 Subject: mount/fuse: Handle racing notify on more than one graph properly Make sure that we always use latest graph as a candidate for active-subvol. Change-Id: Ie37c818366f28ba6b1570d65a9eb17697d38a6c5 BUG: 1448364 Signed-off-by: Raghavendra G Reviewed-on: https://review.gluster.org/17200 Smoke: Gluster Build System Reviewed-by: Amar Tumballi NetBSD-regression: NetBSD Build System Reviewed-by: Jeff Darcy CentOS-regression: Gluster Build System --- xlators/mount/fuse/src/fuse-bridge.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c index 0c409264bf..a0a09a4ec5 100644 --- a/xlators/mount/fuse/src/fuse-bridge.c +++ b/xlators/mount/fuse/src/fuse-bridge.c @@ -5269,8 +5269,12 @@ fuse_graph_setup (xlator_t *this, glusterfs_graph_t *graph) pthread_mutex_lock (&priv->sync_mutex); { - /* handle the case of more than one CHILD_UP on same graph */ - if ((priv->active_subvol == graph->top) || graph->used) { + /* 1. handle the case of more than one CHILD_UP on same graph. + * 2. make sure graph is newer than current active_subvol. + */ + if ((priv->active_subvol == graph->top) || graph->used + || ((priv->active_subvol) + && (priv->active_subvol->graph->id > graph->id))) { goto unlock; } -- cgit