Skip to content

Commit 4457feb

Browse files
the8472marcoieni
andauthored
Apply suggestions from code review
Co-authored-by: Marco Ieni <[email protected]>
1 parent 53b6d43 commit 4457feb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/ci/scripts/free-disk-space-linux.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,8 @@ checkAlternative() {
260260
# ignore-tidy-linelength
261261
local mntopts="defaults,discard,journal_async_commit,barrier=0,noauto_da_alloc,lazytime,data=writeback"
262262

263-
# GHA has a 2nd disk mounted at /mnt that is almost empty
263+
# GHA has a 2nd disk mounted at /mnt that is almost empty.
264+
# Check if it's a valid mountpoint and it has enough available space.
264265
if mountpoint /mnt && [ "$available_space_kb" -ge "$space_target_kb" ]; then
265266
local blkdev=$(df -k "$mountpoint" --output=source | tail -n 1)
266267
echo "Sufficient space available on $blkdev mounted at $mountpoint"
@@ -271,6 +272,8 @@ checkAlternative() {
271272
sudo mount $blkdev ./obj -o $mntopts || sudo dmesg | tail -n 20
272273
sudo chown -R "$USER":"$USER" ./obj
273274

275+
# Exit from this script to avoid wasting time removing disk space,
276+
# as we already have enough disk space in the alternative drive.
274277
exit 0
275278
fi
276279

0 commit comments

Comments
 (0)