Skip to content

fix: ensure discard_max_bytes is set to 0 only for existing block devices#4745

Open
nodece wants to merge 1 commit intoapache:masterfrom
nodece:fix-discard_max_bytes
Open

fix: ensure discard_max_bytes is set to 0 only for existing block devices#4745
nodece wants to merge 1 commit intoapache:masterfrom
nodece:fix-discard_max_bytes

Conversation

@nodece
Copy link
Copy Markdown
Member

@nodece nodece commented Apr 15, 2026

Motivation

In CI environments, the following error was observed when attempting to disable discard:

tee: '/sys/block/sd*/queue/discard_max_bytes': No such file or directory
Error: Process completed with exit code 1.

This happens because the script assumes block devices follow the sd* naming convention, which is not always true (e.g., NVMe or virtual disks). As a result, the glob does not match any files and causes the step to fail.

Modifications

  • Replace /sys/block/sd*/queue/discard_max_bytes with /sys/block/*/queue/discard_max_bytes to support all block device types
  • Add a file existence check (-f) before applying tee to avoid errors when the file is not present

@nodece nodece force-pushed the fix-discard_max_bytes branch from 340c9bc to 5f30f34 Compare April 15, 2026 03:25
@nodece nodece changed the title [fix][ci] Ensure discard_max_bytes is set to 0 only for existing block devices fix: ensure discard_max_bytes is set to 0 only for existing block devices Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant