9f5ccc
From 02a93265fe4e78e7fc3fa8c6caa773cbe02f50b6 Mon Sep 17 00:00:00 2001
9f5ccc
From: Anoop C S <anoopcs@redhat.com>
9f5ccc
Date: Fri, 20 Dec 2019 16:01:59 +0530
9f5ccc
Subject: [PATCH 344/344] Revert all fixes to include SELinux hook scripts
9f5ccc
9f5ccc
Following are the reverts included with this change:
9f5ccc
9f5ccc
Revert "extras/hooks: syntactical errors in SELinux hooks, scipt logic improved"
9f5ccc
Revert "Revert "hooks: remove selinux hooks""
9f5ccc
Revert "tests: subdir-mount.t is failing for brick_mux regrssion"
9f5ccc
Revert "extras/hooks: Install and package newly added post add-brick hook script"
9f5ccc
Revert "extras/hooks: Add SELinux label on new bricks during add-brick"
9f5ccc
9f5ccc
Label: DOWNSTREAM ONLY
9f5ccc
9f5ccc
See bug for more details.
9f5ccc
9f5ccc
Change-Id: I5c9b9e0e6446568ce16af17257fa39338198a827
9f5ccc
BUG: 1686800
9f5ccc
Signed-off-by: Anoop C S <anoopcs@redhat.com>
9f5ccc
Reviewed-on: https://code.engineering.redhat.com/gerrit/188169
9f5ccc
Tested-by: RHGS Build Bot <nigelb@redhat.com>
9f5ccc
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
9f5ccc
---
9f5ccc
 configure.ac                                       |   4 -
9f5ccc
 extras/hook-scripts/Makefile.am                    |   2 +-
9f5ccc
 extras/hook-scripts/add-brick/post/Makefile.am     |   4 +-
9f5ccc
 .../add-brick/post/S10selinux-label-brick.sh       | 100 ---------------------
9f5ccc
 extras/hook-scripts/create/Makefile.am             |   1 -
9f5ccc
 extras/hook-scripts/create/post/Makefile.am        |   6 --
9f5ccc
 .../create/post/S10selinux-label-brick.sh          |  13 ++-
9f5ccc
 extras/hook-scripts/delete/Makefile.am             |   1 -
9f5ccc
 extras/hook-scripts/delete/pre/Makefile.am         |   6 --
9f5ccc
 .../delete/pre/S10selinux-del-fcontext.sh          |  60 ++++++-------
9f5ccc
 glusterfs.spec.in                                  |   3 -
9f5ccc
 tests/bugs/glusterfs-server/bug-877992.t           |   4 +-
9f5ccc
 tests/features/subdir-mount.t                      |  11 +--
9f5ccc
 13 files changed, 37 insertions(+), 178 deletions(-)
9f5ccc
 delete mode 100755 extras/hook-scripts/add-brick/post/S10selinux-label-brick.sh
9f5ccc
 delete mode 100644 extras/hook-scripts/create/Makefile.am
9f5ccc
 delete mode 100644 extras/hook-scripts/create/post/Makefile.am
9f5ccc
 delete mode 100644 extras/hook-scripts/delete/Makefile.am
9f5ccc
 delete mode 100644 extras/hook-scripts/delete/pre/Makefile.am
9f5ccc
9f5ccc
diff --git a/configure.ac b/configure.ac
9f5ccc
index 98ee311..327733e 100644
9f5ccc
--- a/configure.ac
9f5ccc
+++ b/configure.ac
9f5ccc
@@ -221,10 +221,6 @@ AC_CONFIG_FILES([Makefile
9f5ccc
                 extras/hook-scripts/add-brick/Makefile
9f5ccc
                 extras/hook-scripts/add-brick/pre/Makefile
9f5ccc
                 extras/hook-scripts/add-brick/post/Makefile
9f5ccc
-                extras/hook-scripts/create/Makefile
9f5ccc
-                extras/hook-scripts/create/post/Makefile
9f5ccc
-                extras/hook-scripts/delete/Makefile
9f5ccc
-                extras/hook-scripts/delete/pre/Makefile
9f5ccc
                 extras/hook-scripts/start/Makefile
9f5ccc
                 extras/hook-scripts/start/post/Makefile
9f5ccc
                 extras/hook-scripts/set/Makefile
9f5ccc
diff --git a/extras/hook-scripts/Makefile.am b/extras/hook-scripts/Makefile.am
9f5ccc
index 26059d7..771b37e 100644
9f5ccc
--- a/extras/hook-scripts/Makefile.am
9f5ccc
+++ b/extras/hook-scripts/Makefile.am
9f5ccc
@@ -1,5 +1,5 @@
9f5ccc
 EXTRA_DIST = S40ufo-stop.py S56glusterd-geo-rep-create-post.sh
9f5ccc
-SUBDIRS = add-brick create delete set start stop reset
9f5ccc
+SUBDIRS = add-brick set start stop reset
9f5ccc
 
9f5ccc
 scriptsdir = $(GLUSTERD_WORKDIR)/hooks/1/gsync-create/post/
9f5ccc
 if USE_GEOREP
9f5ccc
diff --git a/extras/hook-scripts/add-brick/post/Makefile.am b/extras/hook-scripts/add-brick/post/Makefile.am
9f5ccc
index 9b236df..bfc0c1c 100644
9f5ccc
--- a/extras/hook-scripts/add-brick/post/Makefile.am
9f5ccc
+++ b/extras/hook-scripts/add-brick/post/Makefile.am
9f5ccc
@@ -1,6 +1,6 @@
9f5ccc
-EXTRA_DIST = disabled-quota-root-xattr-heal.sh S10selinux-label-brick.sh S13create-subdir-mounts.sh
9f5ccc
+EXTRA_DIST = disabled-quota-root-xattr-heal.sh S13create-subdir-mounts.sh
9f5ccc
 
9f5ccc
 hookdir = $(GLUSTERD_WORKDIR)/hooks/1/add-brick/post/
9f5ccc
 if WITH_SERVER
9f5ccc
-hook_SCRIPTS = disabled-quota-root-xattr-heal.sh S10selinux-label-brick.sh S13create-subdir-mounts.sh
9f5ccc
+hook_SCRIPTS = disabled-quota-root-xattr-heal.sh S13create-subdir-mounts.sh
9f5ccc
 endif
9f5ccc
diff --git a/extras/hook-scripts/add-brick/post/S10selinux-label-brick.sh b/extras/hook-scripts/add-brick/post/S10selinux-label-brick.sh
9f5ccc
deleted file mode 100755
9f5ccc
index 4a17c99..0000000
9f5ccc
--- a/extras/hook-scripts/add-brick/post/S10selinux-label-brick.sh
9f5ccc
+++ /dev/null
9f5ccc
@@ -1,100 +0,0 @@
9f5ccc
-#!/bin/bash
9f5ccc
-#
9f5ccc
-# Install to hooks/<HOOKS_VER>/add-brick/post
9f5ccc
-#
9f5ccc
-# Add an SELinux file context for each brick using the glusterd_brick_t type.
9f5ccc
-# This ensures that the brick is relabeled correctly on an SELinux restart or
9f5ccc
-# restore. Subsequently, run a restore on the brick path to set the selinux
9f5ccc
-# labels.
9f5ccc
-#
9f5ccc
-###
9f5ccc
-
9f5ccc
-PROGNAME="Sselinux"
9f5ccc
-OPTSPEC="volname:,version:,gd-workdir:,volume-op:"
9f5ccc
-VOL=
9f5ccc
-
9f5ccc
-parse_args () {
9f5ccc
-  ARGS=$(getopt -o '' -l ${OPTSPEC} -n ${PROGNAME} -- "$@")
9f5ccc
-  eval set -- "${ARGS}"
9f5ccc
-
9f5ccc
-  while true; do
9f5ccc
-    case ${1} in
9f5ccc
-      --volname)
9f5ccc
-        shift
9f5ccc
-        VOL=${1}
9f5ccc
-        ;;
9f5ccc
-      --gd-workdir)
9f5ccc
-          shift
9f5ccc
-          GLUSTERD_WORKDIR=$1
9f5ccc
-          ;;
9f5ccc
-      --version)
9f5ccc
-          shift
9f5ccc
-          ;;
9f5ccc
-      --volume-op)
9f5ccc
-          shift
9f5ccc
-          ;;
9f5ccc
-      *)
9f5ccc
-          shift
9f5ccc
-          break
9f5ccc
-          ;;
9f5ccc
-    esac
9f5ccc
-    shift
9f5ccc
-  done
9f5ccc
-}
9f5ccc
-
9f5ccc
-set_brick_labels()
9f5ccc
-{
9f5ccc
-  local volname="${1}"
9f5ccc
-  local fctx
9f5ccc
-  local list=()
9f5ccc
-
9f5ccc
-  fctx="$(semanage fcontext --list -C)"
9f5ccc
-
9f5ccc
-  # wait for new brick path to be updated under
9f5ccc
-  # ${GLUSTERD_WORKDIR}/vols/${volname}/bricks/
9f5ccc
-  sleep 5
9f5ccc
-
9f5ccc
-  # grab the path for each local brick
9f5ccc
-  brickpath="${GLUSTERD_WORKDIR}/vols/${volname}/bricks/"
9f5ccc
-  brickdirs=$(
9f5ccc
-    find "${brickpath}" -type f -exec grep '^path=' {} \; | \
9f5ccc
-    cut -d= -f 2 | \
9f5ccc
-    sort -u
9f5ccc
-  )
9f5ccc
-
9f5ccc
-  # create a list of bricks for which custom SELinux
9f5ccc
-  # label doesn't exist
9f5ccc
-  for b in ${brickdirs}; do
9f5ccc
-    pattern="${b}(/.*)?"
9f5ccc
-    echo "${fctx}" | grep "^${pattern}\s" >/dev/null
9f5ccc
-    if [[ $? -ne 0 ]]; then
9f5ccc
-      list+=("${pattern}")
9f5ccc
-    fi
9f5ccc
-  done
9f5ccc
-
9f5ccc
-  # Add a file context for each brick path in the list and associate with the
9f5ccc
-  # glusterd_brick_t SELinux type.
9f5ccc
-  for p in ${list[@]}
9f5ccc
-  do
9f5ccc
-    semanage fcontext --add -t glusterd_brick_t -r s0 "${p}"
9f5ccc
-  done
9f5ccc
-
9f5ccc
-  # Set the labels for which SELinux label was added above
9f5ccc
-  for b in ${brickdirs}
9f5ccc
-  do
9f5ccc
-    echo "${list[@]}" | grep "${b}" >/dev/null
9f5ccc
-    if [[ $? -eq 0 ]]; then
9f5ccc
-      restorecon -R "${b}"
9f5ccc
-    fi
9f5ccc
-  done
9f5ccc
-}
9f5ccc
-
9f5ccc
-SELINUX_STATE=$(which getenforce && getenforce)
9f5ccc
-[ "${SELINUX_STATE}" = 'Disabled' ] && exit 0
9f5ccc
-
9f5ccc
-parse_args "$@"
9f5ccc
-[ -z "${VOL}" ] && exit 1
9f5ccc
-
9f5ccc
-set_brick_labels "${VOL}"
9f5ccc
-
9f5ccc
-exit 0
9f5ccc
diff --git a/extras/hook-scripts/create/Makefile.am b/extras/hook-scripts/create/Makefile.am
9f5ccc
deleted file mode 100644
9f5ccc
index b083a91..0000000
9f5ccc
--- a/extras/hook-scripts/create/Makefile.am
9f5ccc
+++ /dev/null
9f5ccc
@@ -1 +0,0 @@
9f5ccc
-SUBDIRS = post
9f5ccc
diff --git a/extras/hook-scripts/create/post/Makefile.am b/extras/hook-scripts/create/post/Makefile.am
9f5ccc
deleted file mode 100644
9f5ccc
index 919801a..0000000
9f5ccc
--- a/extras/hook-scripts/create/post/Makefile.am
9f5ccc
+++ /dev/null
9f5ccc
@@ -1,6 +0,0 @@
9f5ccc
-EXTRA_DIST = S10selinux-label-brick.sh
9f5ccc
-
9f5ccc
-scriptsdir = $(GLUSTERD_WORKDIR)/hooks/1/create/post/
9f5ccc
-if WITH_SERVER
9f5ccc
-scripts_SCRIPTS = S10selinux-label-brick.sh
9f5ccc
-endif
9f5ccc
diff --git a/extras/hook-scripts/create/post/S10selinux-label-brick.sh b/extras/hook-scripts/create/post/S10selinux-label-brick.sh
9f5ccc
index f9b4b1a..de242d2 100755
9f5ccc
--- a/extras/hook-scripts/create/post/S10selinux-label-brick.sh
9f5ccc
+++ b/extras/hook-scripts/create/post/S10selinux-label-brick.sh
9f5ccc
@@ -34,21 +34,18 @@ parse_args () {
9f5ccc
 
9f5ccc
 set_brick_labels()
9f5ccc
 {
9f5ccc
-  volname="${1}"
9f5ccc
+  volname=${1}
9f5ccc
 
9f5ccc
   # grab the path for each local brick
9f5ccc
-  brickpath="/var/lib/glusterd/vols/${volname}/bricks/"
9f5ccc
-  brickdirs=$(
9f5ccc
-    find "${brickpath}" -type f -exec grep '^path=' {} \; | \
9f5ccc
-    cut -d= -f 2 | \
9f5ccc
-    sort -u
9f5ccc
-  )
9f5ccc
+  brickpath="/var/lib/glusterd/vols/${volname}/bricks/*"
9f5ccc
+  brickdirs=$(grep '^path=' "${brickpath}" | cut -d= -f 2 | sort -u)
9f5ccc
 
9f5ccc
   for b in ${brickdirs}; do
9f5ccc
     # Add a file context for each brick path and associate with the
9f5ccc
     # glusterd_brick_t SELinux type.
9f5ccc
-    pattern="${b}(/.*)?"
9f5ccc
+    pattern="${b}\(/.*\)?"
9f5ccc
     semanage fcontext --add -t glusterd_brick_t -r s0 "${pattern}"
9f5ccc
+
9f5ccc
     # Set the labels on the new brick path.
9f5ccc
     restorecon -R "${b}"
9f5ccc
   done
9f5ccc
diff --git a/extras/hook-scripts/delete/Makefile.am b/extras/hook-scripts/delete/Makefile.am
9f5ccc
deleted file mode 100644
9f5ccc
index c98a05d..0000000
9f5ccc
--- a/extras/hook-scripts/delete/Makefile.am
9f5ccc
+++ /dev/null
9f5ccc
@@ -1 +0,0 @@
9f5ccc
-SUBDIRS = pre
9f5ccc
diff --git a/extras/hook-scripts/delete/pre/Makefile.am b/extras/hook-scripts/delete/pre/Makefile.am
9f5ccc
deleted file mode 100644
9f5ccc
index 93a6b85..0000000
9f5ccc
--- a/extras/hook-scripts/delete/pre/Makefile.am
9f5ccc
+++ /dev/null
9f5ccc
@@ -1,6 +0,0 @@
9f5ccc
-EXTRA_DIST = S10selinux-del-fcontext.sh
9f5ccc
-
9f5ccc
-scriptsdir = $(GLUSTERD_WORKDIR)/hooks/1/delete/pre/
9f5ccc
-if WITH_SERVER
9f5ccc
-scripts_SCRIPTS = S10selinux-del-fcontext.sh
9f5ccc
-endif
9f5ccc
diff --git a/extras/hook-scripts/delete/pre/S10selinux-del-fcontext.sh b/extras/hook-scripts/delete/pre/S10selinux-del-fcontext.sh
9f5ccc
index e7f4e8f..6eba66f 100755
9f5ccc
--- a/extras/hook-scripts/delete/pre/S10selinux-del-fcontext.sh
9f5ccc
+++ b/extras/hook-scripts/delete/pre/S10selinux-del-fcontext.sh
9f5ccc
@@ -15,55 +15,45 @@ OPTSPEC="volname:"
9f5ccc
 VOL=
9f5ccc
 
9f5ccc
 function parse_args () {
9f5ccc
-  ARGS=$(getopt -o '' -l ${OPTSPEC} -n ${PROGNAME} -- "$@")
9f5ccc
-  eval set -- "${ARGS}"
9f5ccc
-
9f5ccc
-  while true; do
9f5ccc
-    case ${1} in
9f5ccc
-      --volname)
9f5ccc
-        shift
9f5ccc
-        VOL=${1}
9f5ccc
-      ;;
9f5ccc
-      *)
9f5ccc
+        ARGS=$(getopt -o '' -l $OPTSPEC -n $PROGNAME -- "$@")
9f5ccc
+        eval set -- "$ARGS"
9f5ccc
+
9f5ccc
+        while true; do
9f5ccc
+        case $1 in
9f5ccc
+        --volname)
9f5ccc
+         shift
9f5ccc
+         VOL=$1
9f5ccc
+         ;;
9f5ccc
+        *)
9f5ccc
+         shift
9f5ccc
+         break
9f5ccc
+         ;;
9f5ccc
+        esac
9f5ccc
         shift
9f5ccc
-        break
9f5ccc
-      ;;
9f5ccc
-    esac
9f5ccc
-    shift
9f5ccc
-  done
9f5ccc
+        done
9f5ccc
 }
9f5ccc
 
9f5ccc
 function delete_brick_fcontext()
9f5ccc
 {
9f5ccc
-  volname="${1}"
9f5ccc
-
9f5ccc
-  # grab the path for each local brick
9f5ccc
-  brickpath="/var/lib/glusterd/vols/${volname}/bricks/"
9f5ccc
-  brickdirs=$(
9f5ccc
-    find "${brickpath}" -type f -exec grep '^path=' {} \; | \
9f5ccc
-    cut -d= -f 2 | \
9f5ccc
-    sort -u
9f5ccc
-  )
9f5ccc
-
9f5ccc
-  for b in ${brickdirs}
9f5ccc
-  do
9f5ccc
-    # remove the file context associated with the brick path
9f5ccc
-    pattern="${b}(/.*)?"
9f5ccc
-    semanage fcontext --delete "${pattern}"
9f5ccc
+        volname=$1
9f5ccc
 
9f5ccc
-    # remove the labels on brick path.
9f5ccc
-    restorecon -R "${b}"
9f5ccc
- done
9f5ccc
+        # grab the path for each local brick
9f5ccc
+        brickdirs=$(grep '^path=' /var/lib/glusterd/vols/${volname}/bricks/* | cut -d= -f 2)
9f5ccc
 
9f5ccc
+        for b in $brickdirs
9f5ccc
+        do
9f5ccc
+                # remove the file context associated with the brick path
9f5ccc
+                semanage fcontext --delete $b\(/.*\)?
9f5ccc
+        done
9f5ccc
 }
9f5ccc
 
9f5ccc
 SELINUX_STATE=$(which getenforce && getenforce)
9f5ccc
 [ "${SELINUX_STATE}" = 'Disabled' ] && exit 0
9f5ccc
 
9f5ccc
 parse_args "$@"
9f5ccc
-[ -z "${VOL}" ] && exit 1
9f5ccc
+[ -z "$VOL" ] && exit 1
9f5ccc
 
9f5ccc
-delete_brick_fcontext "${VOL}"
9f5ccc
+delete_brick_fcontext $VOL
9f5ccc
 
9f5ccc
 # failure to delete the fcontext is not fatal
9f5ccc
 exit 0
9f5ccc
diff --git a/glusterfs.spec.in b/glusterfs.spec.in
9f5ccc
index 012989a..671ee27 100644
9f5ccc
--- a/glusterfs.spec.in
9f5ccc
+++ b/glusterfs.spec.in
9f5ccc
@@ -1447,13 +1447,11 @@ exit 0
9f5ccc
        %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/add-brick
9f5ccc
        %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/add-brick/post
9f5ccc
             %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/add-brick/post/disabled-quota-root-xattr-heal.sh
9f5ccc
-            %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/add-brick/post/S10selinux-label-brick.sh
9f5ccc
             %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/add-brick/post/S13create-subdir-mounts.sh
9f5ccc
        %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/add-brick/pre
9f5ccc
             %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/add-brick/pre/S28Quota-enable-root-xattr-heal.sh
9f5ccc
        %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/create
9f5ccc
        %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/create/post
9f5ccc
-            %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/create/post/S10selinux-label-brick.sh
9f5ccc
 %ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/create/pre
9f5ccc
 %ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/copy-file
9f5ccc
 %ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/copy-file/post
9f5ccc
@@ -1462,7 +1460,6 @@ exit 0
9f5ccc
        %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/delete/post
9f5ccc
                             %{_sharedstatedir}/glusterd/hooks/1/delete/post/S57glusterfind-delete-post
9f5ccc
        %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/delete/pre
9f5ccc
-            %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/delete/pre/S10selinux-del-fcontext.sh
9f5ccc
 %ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/remove-brick
9f5ccc
 %ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/remove-brick/post
9f5ccc
 %ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/remove-brick/pre
9f5ccc
diff --git a/tests/bugs/glusterfs-server/bug-877992.t b/tests/bugs/glusterfs-server/bug-877992.t
9f5ccc
index 300000b..aeb73ed 100755
9f5ccc
--- a/tests/bugs/glusterfs-server/bug-877992.t
9f5ccc
+++ b/tests/bugs/glusterfs-server/bug-877992.t
9f5ccc
@@ -46,9 +46,7 @@ TEST $CLI volume create $V0 $H0:$B0/${V0}1;
9f5ccc
 EXPECT "$V0" volinfo_field $V0 'Volume Name';
9f5ccc
 EXPECT 'Created' volinfo_field $V0 'Status';
9f5ccc
 EXPECT 'createPre' cat /tmp/pre.out;
9f5ccc
-# Spost.sh comes after S10selinux-label-brick.sh under create post hook script
9f5ccc
-# list. So consider the delay in setting SELinux context on bricks
9f5ccc
-EXPECT_WITHIN 5 'createPost' cat /tmp/post.out;
9f5ccc
+EXPECT 'createPost' cat /tmp/post.out;
9f5ccc
 hooks_cleanup 'create'
9f5ccc
 
9f5ccc
 
9f5ccc
diff --git a/tests/features/subdir-mount.t b/tests/features/subdir-mount.t
9f5ccc
index a02bd6b..8401946 100644
9f5ccc
--- a/tests/features/subdir-mount.t
9f5ccc
+++ b/tests/features/subdir-mount.t
9f5ccc
@@ -85,17 +85,12 @@ TEST $CLI volume start $V0
9f5ccc
 TEST $GFS --subdir-mount /subdir1/subdir1.1/subdir1.2 -s $H0 --volfile-id $V0 $M2
9f5ccc
 TEST stat $M2
9f5ccc
 
9f5ccc
-initcnt=`grep -i create-subdir-mounts /var/log/glusterfs/glusterd.log  | wc -l`
9f5ccc
 # mount shouldn't fail even after add-brick
9f5ccc
 TEST $CLI volume add-brick $V0 replica 2 $H0:$B0/${V0}{5,6};
9f5ccc
 
9f5ccc
-# Wait to execute create-subdir-mounts.sh script by glusterd
9f5ccc
-newcnt=`grep -i create-subdir-mounts /var/log/glusterfs/glusterd.log  | wc -l`
9f5ccc
-while [ $newcnt -eq $initcnt ]
9f5ccc
-do
9f5ccc
-   newcnt=`grep -i create-subdir-mounts /var/log/glusterfs/glusterd.log  | wc -l`
9f5ccc
-   sleep 1
9f5ccc
-done
9f5ccc
+# Give time for client process to get notified and use the new
9f5ccc
+# volfile after add-brick
9f5ccc
+sleep 1
9f5ccc
 
9f5ccc
 # Existing mount should still be active
9f5ccc
 mount_inode=$(stat --format "%i" "$M2")
9f5ccc
-- 
9f5ccc
1.8.3.1
9f5ccc