Repository navigation
block: delay support for error injection - #1370
blktests-ci-kpd[bot] wants to merge 3 commits into
Conversation
|
Upstream branch: 3769bc3 |
7d0b93f to
b4d7c5e
Compare
|
Upstream branch: 648611e |
901fc2f to
2eda9c1
Compare
b4d7c5e to
0ca36dd
Compare
|
Upstream branch: 67cd826 |
2eda9c1 to
9736bc2
Compare
|
Upstream branch: 67cd826 |
9736bc2 to
69ae7a9
Compare
0ca36dd to
d7cbcd8
Compare
|
Upstream branch: 0f7ca97 |
69ae7a9 to
c9e3535
Compare
d7cbcd8 to
9cd2c96
Compare
|
Upstream branch: c71f470 |
c9e3535 to
e67b003
Compare
9cd2c96 to
2186464
Compare
|
Upstream branch: 1f50498 |
e67b003 to
a6a3458
Compare
2186464 to
06b43b2
Compare
|
Upstream branch: 4da93ac |
a6a3458 to
11bc469
Compare
06b43b2 to
b19ce84
Compare
|
Upstream branch: e8b704b |
11bc469 to
f765d0b
Compare
b19ce84 to
233d193
Compare
|
Upstream branch: 75b36d2 |
f765d0b to
fb0a072
Compare
233d193 to
cb90962
Compare
|
Upstream branch: 5219caf |
fb0a072 to
5a499e0
Compare
cb90962 to
71c4ba0
Compare
|
Upstream branch: 34fbfb9 |
5a499e0 to
2a494bb
Compare
71c4ba0 to
294ff85
Compare
tag_to_blk_status() returns BLK_STS_OK both for the "OK" tag and for a tag it does not recognize, so a caller cannot tell the two apart. The block error injection code (which is the sole user of this function currently) relies on error_inject_add() later to reject adding a rule with status=BLK_STS_OK. This is okay for the current state of error injection. The delay option added in the next commit makes the rule with status=OK valid, meaning the function tag_to_blk_status() now needs to explicitly match BLK_STS_OK for it, and fail for a tag it does not recognize. Hence make tag_to_blk_status() take a second param to update the matched status, and return true in case of a successful match. If a match is not found, the function tag_to_blk_status() returns false and *status remains unchanged. A repeated status= where an invalid tag comes first is now rejected instead of being overridden by the later one. Cc: Christoph Hellwig <hch@lst.de> Assisted-by: Claude:claude-opus-5 Signed-off-by: Md Haris Iqbal <haris.iqbal@linux.dev> Reviewed-by: Christoph Hellwig <hch@lst.de>
Error injection can only fail a bio today. Add a delay_us option so that a rule can hold a bio back first, to model a slow device. If a matching rule has delay_us set, the bio is held for that long. It is then failed if the rule also has a status, or resubmitted otherwise. The resubmission is done through submit_bio_noacct_nocheck(), which is where the injection hook sits. To avoid the same delay rule being applied to it again, mark the bio with the BIO_ERROR_INJECTED flag before queueing the work in blk_error_inject_delay(). This also prevents bios that are split later and resubmitted from being evaluated for delay (or error injection) again. __bio_clone() does not propagate the flag, so a clone a stacking driver aims at a lower device is still evaluated. The bio is submitted from a workqueue rather than from the timer, because submitting a bio can sleep. Bios with REQ_NOWAIT are never delayed, and values above 600 seconds are rejected. Cc: Christoph Hellwig <hch@lst.de> Assisted-by: Claude:claude-opus-5 Signed-off-by: Md Haris Iqbal <haris.iqbal@linux.dev>
Document the delay_us option: the delay happens above the driver, a delayed bio is not run through the rules again, and holding a bio back reorders it against bios submitted later. Cc: Christoph Hellwig <hch@lst.de> Assisted-by: Claude:claude-opus-5 Signed-off-by: Md Haris Iqbal <haris.iqbal@linux.dev> Reviewed-by: Christoph Hellwig <hch@lst.de>
|
Upstream branch: f9d56ee |
2a494bb to
04e5f4b
Compare
Pull request for series with
subject: block: delay support for error injection
version: 3
url: https://patchwork.kernel.org/series/1175637/