diff options
author | Raghavendra G <rgowdapp@redhat.com> | 2016-11-10 10:56:26 +0530 |
---|---|---|
committer | Raghavendra G <rgowdapp@redhat.com> | 2017-05-10 09:14:30 +0000 |
commit | e71119e942eb016ba5a11c3f986715f16da10b82 (patch) | |
tree | 722334df87a5c3a309344a5d7188ac284c1d4e63 | |
parent | 284451110add7b95c6ddaa2d2aa21fc7528e4f2b (diff) |
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 <rgowdapp@redhat.com>
Reviewed-on: https://review.gluster.org/17200
Smoke: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Jeff Darcy <jeff@pl.atyp.us>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
-rw-r--r-- | xlators/mount/fuse/src/fuse-bridge.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c index 0c409264bf7..a0a09a4ec57 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; } |