From: cuishuang <imcusg@gmail.com>
To: alexs@kernel.org, si.yanteng@linux.dev
Cc: dzm91@hust.edu.cn, corbet@lwn.net, skhan@linuxfoundation.org,
wangyuli@aosc.io, kezijie@leap-io-kernel.com,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2] docs/zh_CN: Add configurable error injection translation
Date: Wed, 22 Jul 2026 18:00:53 +0800 [thread overview]
Message-ID: <20260722100053.71691-1-imcusg@gmail.com> (raw)
Translate Documentation/block/error-injection.rst into Chinese and add
it to the Chinese block documentation index.
Update the translation through commit e8dcf2d142bd
("block: add configurable error injection").
Signed-off-by: cuishuang <imcusg@gmail.com>
---
v1->v2:
- Add the required Assisted-by trailer.
- Resend via authenticated SMTP because the original message was only
partially delivered and did not reach the linux-doc archive.
.../zh_CN/block/error-injection.rst | 63 +++++++++++++++++++
.../translations/zh_CN/block/index.rst | 1 +
2 files changed, 64 insertions(+)
create mode 100644 Documentation/translations/zh_CN/block/error-injection.rst
diff --git a/Documentation/translations/zh_CN/block/error-injection.rst b/Documentation/translations/zh_CN/block/error-injection.rst
new file mode 100644
index 000000000000..91563ea055ba
--- /dev/null
+++ b/Documentation/translations/zh_CN/block/error-injection.rst
@@ -0,0 +1,63 @@
+.. SPDX-License-Identifier: GPL-2.0
+.. include:: ../disclaimer-zh_CN.rst
+
+:Original: Documentation/block/error-injection.rst
+
+:翻译:
+
+ cuishuang <imcusg@gmail.com>
+
+==============
+可配置错误注入
+==============
+
+概述
+----
+
+可配置错误注入允许针对块设备的扇区范围注入特定的块层状态码。错误可以无条件
+注入,也可以按给定概率注入。
+
+要使用可配置错误注入,必须启用 ``CONFIG_BLK_ERROR_INJECTION``。
+
+唯一的接口是 ``error_injection`` debugfs 文件,每个已注册的 gendisk 都会
+创建该文件。写入此文件用于创建或删除规则,读取则返回当前错误注入点的列表。
+
+选项
+----
+
+以下选项指定操作:
+
+=================== =======================================================
+add 添加一条新规则
+removeall 删除所有现有规则
+=================== =======================================================
+
+以下选项指定 ``add`` 操作的规则详情:
+
+=================== =======================================================
+op=<string> 此规则适用的块层操作。它使用每个 ``REQ_OP_XYZ``
+ 操作中的 ``XYZ``,例如 ``READ``、``WRITE`` 或
+ ``DISCARD``。必填。
+status=<string> 要返回的状态。它使用每个 ``BLK_STS_XYZ`` 状态码
+ 中的 ``XYZ``,例如 ``IOERR`` 或 ``MEDIUM``。必填。
+start=<number> 此规则适用的第一个块层扇区。可选,默认为 0。
+nr_sectors=<number> 此规则适用的扇区数。可选,默认覆盖设备的剩余部分。
+chance=<number> 仅以 ``1/chance`` 的概率返回失败。可选,默认为 1
+ (总是失败)。
+=================== =======================================================
+
+示例
+----
+
+对 ``/dev/nvme0n1`` 扇区 0 的读取,每 10 次中有一次返回
+``BLK_STS_IOERR``:
+
+ $ echo 'add,op=READ,start=0,status=IOERR,chance=10' > /sys/kernel/debug/block/nvme0n1/error_injection
+
+对 ``/dev/nvme0n1`` 的每次写入都返回 ``BLK_STS_MEDIUM``:
+
+ $ echo 'add,op=WRITE,start=0,status=MEDIUM' > /sys/kernel/debug/block/nvme0n1/error_injection
+
+删除 ``/dev/nvme0n1`` 的所有规则:
+
+ $ echo 'removeall' > /sys/kernel/debug/block/nvme0n1/error_injection
diff --git a/Documentation/translations/zh_CN/block/index.rst b/Documentation/translations/zh_CN/block/index.rst
index f2ae5096ed68..4877432cc4ff 100644
--- a/Documentation/translations/zh_CN/block/index.rst
+++ b/Documentation/translations/zh_CN/block/index.rst
@@ -18,6 +18,7 @@ Block
blk-mq
data-integrity
+ error-injection
TODOList:
* bfq-iosched
--
2.50.1 (Apple Git-155)
next reply other threads:[~2026-07-22 10:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-22 10:00 cuishuang [this message]
2026-07-22 10:42 ` [PATCH v2] docs/zh_CN: Add configurable error injection translation Weijie Yuan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260722100053.71691-1-imcusg@gmail.com \
--to=imcusg@gmail.com \
--cc=alexs@kernel.org \
--cc=corbet@lwn.net \
--cc=dzm91@hust.edu.cn \
--cc=kezijie@leap-io-kernel.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=si.yanteng@linux.dev \
--cc=skhan@linuxfoundation.org \
--cc=wangyuli@aosc.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.