diff options
author | Vijay Bellur <vijay@gluster.com> | 2012-05-10 22:18:20 -0700 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2012-05-10 22:18:20 -0700 |
commit | 4ab1c326f3862714b960302f06c6323d6291b695 (patch) | |
tree | 1e4e96e70b1463c96f76dcf61a1f451783c0d340 /xlators/mount/fuse/utils/mount.glusterfs.in | |
parent | 7319017fae450af1d8988bc3a95eec40d913e701 (diff) |
Revert "fuse: allow requests during mount (needed for SELinux labels)"
This reverts commit 7d0397c2144810c8a396e00187a6617873c94002.
Diffstat (limited to 'xlators/mount/fuse/utils/mount.glusterfs.in')
-rwxr-xr-x | xlators/mount/fuse/utils/mount.glusterfs.in | 55 |
1 files changed, 13 insertions, 42 deletions
diff --git a/xlators/mount/fuse/utils/mount.glusterfs.in b/xlators/mount/fuse/utils/mount.glusterfs.in index 37cc2f9f6..3ca09b03b 100755 --- a/xlators/mount/fuse/utils/mount.glusterfs.in +++ b/xlators/mount/fuse/utils/mount.glusterfs.in @@ -34,36 +34,6 @@ _init () UPDATEDBCONF=/etc/updatedb.conf } -# Mount happens asynchronously, so the command status alone will never be -# sufficient. Instead, we have to wait for multiple events representing -# different possible outcomes. -wait_for () -{ - local daemon_pid=$1 - local mount_point=$2 - - waited=0 - while true; do - kill -s 0 $daemon_pid - if [ $? != 0 ]; then - echo "Gluster client daemon exited unexpectedly." - umount $mount_point &> /dev/null - exit 1 - fi - inode=$(stat -c %i $mount_point 2>/dev/null); - if [ "$inode" = "1" ]; then - break - fi - if [ $waited -ge 10 ]; then - break - fi - sleep 1 - waited=$((waited+1)) - done - - echo "$inode" -} - start_glusterfs () { if [ -n "$log_level_str" ]; then @@ -151,33 +121,34 @@ start_glusterfs () cmd_line=$(echo "$cmd_line --volfile=$volfile_loc"); fi - cmd_line=$(echo "$cmd_line $mount_point") - err=0 - $cmd_line - daemon_pid=$$ + cmd_line=$(echo "$cmd_line $mount_point"); + err=0; + $cmd_line; + + + inode=$(stat -c %i $mount_point 2>/dev/null); - # Wait for the inode to change *or* for the daemon to exit (indicating a - # problem with the mount). - inode=$(wait_for $daemon_pid $mount_point) # this is required if the stat returns error if [ -z "$inode" ]; then - inode="0" + inode="0"; fi # retry the failover + # if [ $? != "0" ]; then # <--- TODO: Once glusterfs returns proper error code, change it. if [ $inode -ne 1 ]; then + err=1; if [ -n "$cmd_line1" ]; then cmd_line1=$(echo "$cmd_line1 $mount_point"); - $cmd_line1 - daemon_pid=$$ + $cmd_line1; + err=0; - inode=$(wait_for $daemon_pid $mount_point) + inode=$(stat -c %i $mount_point 2>/dev/null); # this is required if the stat returns error if [ -z "$inode" ]; then inode="0"; fi if [ $inode -ne 1 ]; then - err=1 + err=1; fi fi fi |