All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] docs/zh_CN: Add configurable error injection translation
@ 2026-07-22 10:00 cuishuang
  2026-07-22 10:42 ` Weijie Yuan
  0 siblings, 1 reply; 2+ messages in thread
From: cuishuang @ 2026-07-22 10:00 UTC (permalink / raw)
  To: alexs, si.yanteng
  Cc: dzm91, corbet, skhan, wangyuli, kezijie, linux-doc, linux-kernel

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)


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-07-22 10:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-22 10:00 [PATCH v2] docs/zh_CN: Add configurable error injection translation cuishuang
2026-07-22 10:42 ` Weijie Yuan

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.