Skip to content

Commit ad2b6e9

Browse files
authored
fix: ensure discard_max_bytes is set to 0 only for existing block devices (#4745)
1 parent 6fac859 commit ad2b6e9

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

.github/actions/tune-runner-vm/action.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,10 @@ runs:
5757
sudo mount -o remount,nodiscard,commit=999999,barrier=0 /mnt || true
5858
# disable discard/trim at device level since remount with nodiscard doesn't seem to be effective
5959
# https://www.spinics.net/lists/linux-ide/msg52562.html
60-
for i in /sys/block/sd*/queue/discard_max_bytes; do
61-
echo 0 | sudo tee $i
60+
for i in /sys/block/*/queue/discard_max_bytes; do
61+
if [ -f "$i" ]; then
62+
echo 0 | sudo tee "$i"
63+
fi
6264
done
6365
# disable any background jobs that run SSD discard/trim
6466
sudo systemctl disable fstrim.timer || true

0 commit comments

Comments
 (0)