Urgent.News

What's breaking now, across thousands of outlets.

Tech

[$] Block-layer error injection

Storage code has to cope with hardware that fails in inconvenient ways, but coaxing a healthy disk into producing those failures on demand, for testing, is usually not possible. The kernel provides several ways to inject block-layer I/O errors, but none of those can select the operation to fail, pick the status code to return, or target a disk directly without employing a stacked device on top.…

Storage systems must be able to handle hardware failure, but creating those failures on demand for testing is often not feasible. The kernel offers various methods to inject block-layer I/O errors, but they cannot specify the operation, return status, or target a disk directly without using a stacked device. This results in tests running against the mapper device, not the intended disk.

A patch series by Christoph Hellwig introduces a configurable error-injection interface that addresses these limitations. It can select the operation, return status, and target a disk using per-disk debugfs files. Prior to this, the block-layer fault injection only treated every request the same, unable to differentiate between read, write, or discard operations, and could only fail requests with BLK_STS_IOERR.

The new system provides more granular control over error injection, enabling tests to target specific operations, sectors, and probabilities.

Written by urgent.news from LWN's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at lwn.net →

More in Tech

More from Wednesday 12 August →