Patchwork [BRANCH:release-3.2,BUG:3091,2/2] mount/fuse: wait till CHILD_UP event is recieved to do the first lookup.

login
register
Submitter Raghavendra G
Date 2011-06-30 08:48:58
Message ID <20110630084858.GA7748@shell.gluster.com>
Download mbox | patch
Permalink /patch/7696/
State Accepted
Headers show

Comments

Raghavendra G - 2011-06-30 08:48:58
Signed-off-by: Raghavendra G <raghavendra@gluster.com>
---
 xlators/mount/fuse/src/fuse-bridge.c |   11 ++---------
 1 files changed, 2 insertions(+), 9 deletions(-)
Anand Avati - 2011-06-30 10:04:24
This change will break in the case where the first notify is not
CHILD_UP from the subvolume. Please make sure pthread_cond_broadcast
is done on the first notify coming from the subvol (which could be
CHILD_DOWN or CONNECTING). Also test in cases where you are trying to
mount when some of the bricks are down.

Avati

On Thu, Jun 30, 2011 at 2:18 PM, Raghavendra G <raghavendra@gluster.com> wrote:
>
> Signed-off-by: Raghavendra G <raghavendra@gluster.com>
> ---
>  xlators/mount/fuse/src/fuse-bridge.c |   11 ++---------
>  1 files changed, 2 insertions(+), 9 deletions(-)
>
> diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c
> index 6eea75b..9f273a3 100644
> --- a/xlators/mount/fuse/src/fuse-bridge.c
> +++ b/xlators/mount/fuse/src/fuse-bridge.c
> @@ -3026,8 +3026,6 @@ fuse_graph_sync (xlator_t *this)
>  {
>         fuse_private_t   *priv = NULL;
>         int               need_first_lookup = 0;
> -        struct timeval    now = {0, };
> -        struct timespec   timeout = {0, };
>         int               ret = 0;
>
>         priv = this->private;
> @@ -3041,14 +3039,9 @@ fuse_graph_sync (xlator_t *this)
>                 priv->next_graph = NULL;
>                 need_first_lookup = 1;
>
> -                gettimeofday (&now, NULL);
> -                timeout.tv_sec = now.tv_sec + MAX_FUSE_PROC_DELAY;
> -                timeout.tv_nsec = now.tv_usec * 1000;
> -
>                 while (!priv->child_up) {
> -                        ret = pthread_cond_timedwait (&priv->sync_cond,
> -                                                      &priv->sync_mutex,
> -                                                      &timeout);
> +                        ret = pthread_cond_wait (&priv->sync_cond,
> +                                                 &priv->sync_mutex);
>                         if (ret != 0) {
>                                  gf_log (this->name, GF_LOG_DEBUG,
>                                          "timedwait returned non zero value "
> --
> 1.5.5
>
>

Patch

diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c
index 6eea75b..9f273a3 100644
--- a/xlators/mount/fuse/src/fuse-bridge.c
+++ b/xlators/mount/fuse/src/fuse-bridge.c
@@ -3026,8 +3026,6 @@  fuse_graph_sync (xlator_t *this)
 {
         fuse_private_t   *priv = NULL;
         int               need_first_lookup = 0;
-        struct timeval    now = {0, };
-        struct timespec   timeout = {0, };
         int               ret = 0;
 
         priv = this->private;
@@ -3041,14 +3039,9 @@  fuse_graph_sync (xlator_t *this)
                 priv->next_graph = NULL;
                 need_first_lookup = 1;
 
-                gettimeofday (&now, NULL);
-                timeout.tv_sec = now.tv_sec + MAX_FUSE_PROC_DELAY;
-                timeout.tv_nsec = now.tv_usec * 1000;
-
                 while (!priv->child_up) {
-                        ret = pthread_cond_timedwait (&priv->sync_cond,
-                                                      &priv->sync_mutex,
-                                                      &timeout);
+                        ret = pthread_cond_wait (&priv->sync_cond,
+                                                 &priv->sync_mutex);
                         if (ret != 0) {
 			          gf_log (this->name, GF_LOG_DEBUG,
 					  "timedwait returned non zero value "