From: Arshad Hussain Date: Fri, 5 Jul 2019 14:59:35 +0000 (+0530) Subject: LU-12089 scripts: Fix style issues for statechange-lustre.sh X-Git-Tag: 2.12.57~88 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=24d1d956ea33cdb1fd772fa2ff5bd3137d271242 LU-12089 scripts: Fix style issues for statechange-lustre.sh This patch fixes issues reported by checkpatch for file lustre/scripts/statechange-lustre.sh Test-Parameters: trivial Signed-off-by: Arshad Hussain Change-Id: I202200f16681ea56916beb4b56f7406fccdf39d9 Reviewed-on: https://review.whamcloud.com/35429 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: James Nunez --- diff --git a/lustre/scripts/statechange-lustre.sh b/lustre/scripts/statechange-lustre.sh index c3225b2..5c72ce4 100755 --- a/lustre/scripts/statechange-lustre.sh +++ b/lustre/scripts/statechange-lustre.sh @@ -46,43 +46,42 @@ zed_check_cmd "$ZFS" || exit 3 # sync_degrade_state() { - local dataset="$1" - local state="$2" - local service=$($ZFS list -H -o lustre:svname ${dataset}) + local dataset="$1" + local state="$2" + local service=$($ZFS list -H -o lustre:svname ${dataset}) - zed_log_msg "Lustre:sync_degrade_state pool:${dataset} degraded:${state}" + zed_log_msg "Lustre:sync_degrade_state pool:${dataset} degraded:${state}" - if [ -n "${service}" ] && [ "${service}" != "-" ] ; then - local current=$($LCTL get_param -n obdfilter.${service}.degraded) + if [ -n "${service}" ] && [ "${service}" != "-" ] ; then + local current=$($LCTL get_param -n obdfilter.${service}.degraded) - if [ "${current}" != "${state}" ] ; then - $LCTL set_param obdfilter.${service}.degraded=${state} + if [ "${current}" != "${state}" ] ; then + $LCTL set_param obdfilter.${service}.degraded=${state} + fi fi - fi } - # # use pool state as deciding factor # POOL_STATE=$($ZPOOL list -H -o health ${ZEVENT_POOL}) if [ "${POOL_STATE}" == "ONLINE" ] ; then - MODE="0" + MODE="0" elif [ "${POOL_STATE}" == "DEGRADED" ] ; then - MODE="1" + MODE="1" else - exit 4 + exit 4 fi # # visit target pool's datasets and adjust lustre service degrade mode # read -r -a DATASETS <<< \ - $($ZFS get -rH -s local -t filesystem -o name lustre:svname ${ZEVENT_POOL}) + $($ZFS get -rH -s local -t filesystem -o name lustre:svname ${ZEVENT_POOL}) for dataset in "${DATASETS[@]}" ; do - sync_degrade_state "${dataset}" "${MODE}" + sync_degrade_state "${dataset}" "${MODE}" done exit 0