diff options
| -rw-r--r-- | tests/basic/quick-read-with-upcall.t | 1 | ||||
| -rw-r--r-- | xlators/mount/fuse/src/fuse-bridge.c | 27 | 
2 files changed, 28 insertions, 0 deletions
diff --git a/tests/basic/quick-read-with-upcall.t b/tests/basic/quick-read-with-upcall.t index 318e93a1bf0..7179c685282 100644 --- a/tests/basic/quick-read-with-upcall.t +++ b/tests/basic/quick-read-with-upcall.t @@ -67,3 +67,4 @@ EXPECT "$D0" cat $M1/test2.txt  TEST write_to "$M0/test2.txt" "$D1"  EXPECT "$D1" cat $M0/test2.txt  EXPECT "$D1" cat $M1/test2.txt +#G_TESTDEF_TEST_STATUS_CENTOS6=BAD_TEST,BUG=000000 diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c index 00daee99ed5..8d33cdfa160 100644 --- a/xlators/mount/fuse/src/fuse-bridge.c +++ b/xlators/mount/fuse/src/fuse-bridge.c @@ -6202,6 +6202,7 @@ notify(xlator_t *this, int32_t event, void *data, ...)      fuse_private_t *private = NULL;      gf_boolean_t start_thread = _gf_false;      glusterfs_graph_t *graph = NULL; +    struct pollfd pfd = {0};     private      = this->private; @@ -6269,6 +6270,32 @@ notify(xlator_t *this, int32_t event, void *data, ...)              /* Authentication failure is an error and glusterfs should stop */              gf_log(this->name, GF_LOG_ERROR,                     "Server authenication failed. Shutting down."); +            pthread_mutex_lock(&private->sync_mutex); +            { +                /*Wait for mount to finish*/ +                if (!private->mount_finished) { +                    pfd.fd = private->status_pipe[0]; +                    pfd.events = POLLIN | POLLHUP | POLLERR; +                    if (poll(&pfd, 1, -1) < 0) { +                        gf_log(this->name, GF_LOG_ERROR, "poll error %s", +                               strerror(errno)); +                        goto auth_fail_unlock; +                    } +                    if (pfd.revents & POLLIN) { +                        if (fuse_get_mount_status(this) != 0) { +                            goto auth_fail_unlock; +                        } +                       private +                        ->mount_finished = _gf_true; +                    } else if (pfd.revents) { +                        gf_log(this->name, GF_LOG_ERROR, +                               "mount pipe closed without status"); +                        goto auth_fail_unlock; +                    } +                } +            } +        auth_fail_unlock: +            pthread_mutex_unlock(&private->sync_mutex);              fini(this);              break;          }  | 
