From 5053f962743ae607a9384a67bb16682aff90b7cc Mon Sep 17 00:00:00 2001 From: Alexander Stuart-Kregor <592657+easkay@users.noreply.github.com> Date: Tue, 13 Mar 2018 13:17:49 +0000 Subject: [PATCH] Swap max_hw_sectors_kb for max_sectors_kb. Fixes #5633. (#5638) --- docs/deployment/kernel-tuning/disk-tuning.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/deployment/kernel-tuning/disk-tuning.sh b/docs/deployment/kernel-tuning/disk-tuning.sh index 9d8771079..9b53671e4 100644 --- a/docs/deployment/kernel-tuning/disk-tuning.sh +++ b/docs/deployment/kernel-tuning/disk-tuning.sh @@ -14,6 +14,8 @@ ## See the License for the specific language governing permissions and ## limitations under the License. +# This script changes protected files, and must be run as root + for i in $(ls -d /sys/block/*/queue/iosched 2>/dev/null); do iosched_dir=$(echo $i | awk '/iosched/ {print $1}') [ -z $iosched_dir ] && { @@ -42,7 +44,7 @@ for i in $(ls -d /sys/block/*/queue/iosched 2>/dev/null); do ## This is the maximum number of kilobytes ## supported in a single data transfer at ## block layer. - [ -f $path/max_hw_sectors_kb ] && { - echo "1024" > $path/max_hw_sectors_kb + [ -f $path/max_sectors_kb ] && { + echo "1024" > $path/max_sectors_kb || true } done