Linux Documentation
 help / color / mirror / Atom feed
* [PATCH v3] docs/zh_CN: Add configurable error injection translation
@ 2026-07-22 12:32 cuishuang
  0 siblings, 0 replies; only message in thread
From: cuishuang @ 2026-07-22 12:32 UTC (permalink / raw)
  To: alexs, si.yanteng
  Cc: dzm91, corbet, skhan, wangyuli, kezijie, linux-doc, linux-kernel,
	Cui Shuang

From: Cui Shuang <imcusg@gmail.com>

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").

Assisted-by: Codex:gpt-5
Signed-off-by: Cui Shuang <imcusg@gmail.com>
---
v2->v3:
  - Add the missing Assisted-by trailer to the commit message.
  - Use "Cui Shuang" consistently as the contributor name.

v1->v2:
  - Resend via authenticated SMTP after 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..63aac2fb38f8
--- /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
+
+:翻译:
+
+ Cui Shuang <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)


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-07-22 12:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-22 12:32 [PATCH v3] docs/zh_CN: Add configurable error injection translation cuishuang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox