Skip to contentSkip to conversation

docs/zh_CN: Add configurable error injection translation

PATCH In review cuishuang 2 participants 2 messages Jul 22 – Sep 7

Subsystems (2)
lore
Share & tools
lore

cuishuang

author
#0 lore raw

PATCH v3 1/1 docs/zh_CN: Add configurable error injection translation

From: Cui Shuang <[email protected]>

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

---
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
Documentation/translations/zh_CN/block/error-injection.rst new file +63 -0
new file mode 100644
index 000000000000..63aac2fb38f8
@@ -0,0 +1,63 @@
+.. SPDX-License-Identifier: GPL-2.0
+.. include:: ../disclaimer-zh_CN.rst
+
+:Original: Documentation/block/error-injection.rst
+
+:翻译:
+
+ Cui Shuang <[email protected]>
+
+==============
+可配置错误注入
+==============
+
+概述
+----
+
+可配置错误注入允许针对块设备的扇区范围注入特定的块层状态码。错误可以无条件
+注入,也可以按给定概率注入。
+
+要使用可配置错误注入,必须启用 ``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
Documentation/translations/zh_CN/block/index.rst +1 -0
index f2ae5096ed68..4877432cc4ff 100644
@@ -18,6 +18,7 @@ Block
 
    blk-mq
    data-integrity
+   error-injection
 
 TODOList:
 * bfq-iosched
Signature · 1 line
2.50.1 (Apple Git-155)
#1 lore raw
Quoted 43 lines · cuishuang

From: Cui Shuang<[email protected]>

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

---
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

Documentation/translations/zh_CN/block/error-injection.rst new file +13 -0
new file mode 100644
index 000000000000..63aac2fb38f8
@@ -0,0 +1,63 @@
+.. SPDX-License-Identifier: GPL-2.0
+.. include:: ../disclaimer-zh_CN.rst
+
+:Original: Documentation/block/error-injection.rst
+
+:翻译:
+
+ Cui Shuang<[email protected]>
+
+==============
+可配置错误注入
+==============
+

Documentation/translations/zh_CN/block/error-injection.rst line 23

Quoted 10 lines
Documentation/translations/zh_CN/block/error-injection.rst new file +10 -0
+概述
+----
+
+可配置错误注入允许针对块设备的扇区范围注入特定的块层状态码。错误可以无条件
+注入,也可以按给定概率注入。
+
+要使用可配置错误注入,必须启用 ``CONFIG_BLK_ERROR_INJECTION``。
+
+唯一的接口是 ``error_injection`` debugfs 文件,每个已注册的 gendisk 都会
+创建该文件。写入此文件用于创建或删除规则,读取则返回当前错误注入点的列表。

"读取则返回当前错误注入点的列表", could you polish this word? make it more nature in Chinese.> +

Quoted 7 lines
Documentation/translations/zh_CN/block/error-injection.rst new file +7 -0
+选项
+----
+
+以下选项指定操作:
+
+===================	=======================================================
+add			添加一条新规则

Documentation/translations/zh_CN/block/error-injection.rst line 41

Quoted 10 lines
Documentation/translations/zh_CN/block/error-injection.rst new file +10 -0
+removeall		删除所有现有规则
+===================	=======================================================
+
+以下选项指定 ``add`` 操作的规则详情:
+
+===================	=======================================================
+op=<string>		此规则适用的块层操作。它使用每个 ``REQ_OP_XYZ``
+			操作中的 ``XYZ``,例如 ``READ``、``WRITE`` 或
+			``DISCARD``。必填。
+status=<string>		要返回的状态。它使用每个 ``BLK_STS_XYZ`` 状态码

Incorrect indent. take care the alignment.

Thanks
Alex

Quoted 36 lines
Documentation/translations/zh_CN/block/error-injection.rst new file +22 -0
+			中的 ``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
Documentation/translations/zh_CN/block/index.rst +1 -1
index f2ae5096ed68..4877432cc4ff 100644
@@ -18,6 +18,7 @@ Block
 
     blk-mq
     data-integrity
+   error-injection
 
  TODOList:
  * bfq-iosched
-- 2.50.1 (Apple Git-155)