Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp2349006rdb; Mon, 25 Dec 2023 07:03:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IH7Kxgjk0+3N4ZFXnAf8dHsKv8NU2aw25Fz+iDYatEqZY3DxxI7U21Nm1qz7b6R5m4MPz2i X-Received: by 2002:a05:600c:46c7:b0:40b:5583:e44a with SMTP id q7-20020a05600c46c700b0040b5583e44amr4177847wmo.0.1703516617547; Mon, 25 Dec 2023 07:03:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703516617; cv=none; d=google.com; s=arc-20160816; b=zS+/Jw5KTqqb6oK8GXCWoDtApWJCCuMU5WtROzIIlGyU4ePrzMoPtHYkfgCKw+W6xn gYHcFA5dm1yH9DFSRcEF63+A09jgJw1z9RltnCGMzEwFiOfcS2C/gasmxSDPTM3pRSRv pbzBA1gbdK9NrTz8hdPqSpU5FcyEbFmNMedCt7bMhXYHlCDSJeH0fkSHF3O3R8J6oxJN NQZMFVKOx0qT4zNH6pCyw9YWGG1wUa1fXskhYRZ5QVZPoOhXeo8ewhZ7l8naf4vZ0axr XXTs3H+VMYT6vOc8P/uhS6axXwNhHTU3EwKOXLFV+e/C6Q8Prd/nadM/WZpltkhLmO4w gR3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=/HJ10D1/s2EgBncKza3Ec0VMa4q9v5SD8GAjEVlmqx0=; fh=XjbPFQV1q33pSyHU0DJViPof6LxQPkAWDXnCrlkcrhg=; b=AjXW6bV0qe44RqgN/WEq4ebtSxpWQUv0R4ZzwQnTZaceBQKerKS2HV/EFFikXKvXHg J3kx6/tRo3BXBGsW/GwgaLqxK04HhW2eIpA6xg6s+6RoFt8N6aQ+IAJflrNyNDfoAo4Z WggBkuKsXmpETPok8B/evEXgluYh4EsqWnpdWybK8ylgWYWqacAFDdv+yPlJmM6YGUND AeZaceBwCKve3nOfPYDYFZzATH2irBVP9/a1u+Q2Q3hU+1sGe4BxNTuLmSghulNct76m 84tFGltQ5aAWeYFC7aKV+KOg1Yu+FyIT/sZ83yPRfLdwH3h2Kwlix5cV9OA6I5eFo1OQ 8new== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-11093-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11093-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id h3-20020a1709063b4300b00a26a93734fcsi4042381ejf.23.2023.12.25.07.03.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Dec 2023 07:03:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-11093-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-11093-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11093-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 4EB871F21474 for ; Mon, 25 Dec 2023 15:03:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7AD1252F84; Mon, 25 Dec 2023 15:03:17 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2D720524B8 for ; Mon, 25 Dec 2023 15:03:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.48]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4SzLk0441qzMp2j; Mon, 25 Dec 2023 23:02:48 +0800 (CST) Received: from dggpemd200001.china.huawei.com (unknown [7.185.36.224]) by mail.maildlp.com (Postfix) with ESMTPS id 37E5018001C; Mon, 25 Dec 2023 23:03:09 +0800 (CST) Received: from huawei.com (10.175.104.67) by dggpemd200001.china.huawei.com (7.185.36.224) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.2.1258.28; Mon, 25 Dec 2023 23:03:08 +0800 From: ZhaoLong Wang To: , , CC: , , , , , Subject: [PATCH V6 0/5] Date: Mon, 25 Dec 2023 23:00:44 +0800 Message-ID: <20231225150049.183756-1-wangzhaolong1@huawei.com> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpemd200001.china.huawei.com (7.185.36.224) The kernel provides a powerful fault injection framework, which provides rich configurable fault injection attributes during runtime. So it can be used to improve the fault injection capability of the UBI driver. This series of patches refactors the existing fault injection interface and add some fault injection types to help testers and developers find potential problems in the code. This series of patches enhance the existing fault injection interface and retain the old debugfs interface, and add some fault injection types to help testers and developers look for potential problems in the code. v2: - Retain the old fault injection interface. v3: 1. Corrects the initialization of the error mask, which should start at 1. 2. Change the read format of the mask value to readable hexadecimal. 3. The interface definition style is consistent when when adding the new interface. 4. Redundant macros are removed. 5. Correct the fault injection hook position error: ubi_io_read_data -> ubi_io_write_data. 6. UBI_IO_BITFLIPS is returned in ubi_io_read() in advance to prevent the return value from being overwritten. 7. In the last commit, an example of the use of fail_function is given. v4: - Delete redundant space characters. v5: - Delete the redundant semicolon of the first patch. v6: - Check the patch completely and fix English syntax errors. ZhaoLong Wang (5): ubi: Use the fault injection framework to enhance the fault injection capability ubi: Split io_failures into write_failure and erase_failure ubi: Add six fault injection type for testing ubi: Reserve sufficient buffer length for the input mask mtd: Add several functions to the fail_function list drivers/mtd/mtdcore.c | 5 + drivers/mtd/ubi/Kconfig | 9 ++ drivers/mtd/ubi/debug.c | 108 ++++++++++++-- drivers/mtd/ubi/debug.h | 304 +++++++++++++++++++++++++++++++++++++--- drivers/mtd/ubi/io.c | 86 +++++++++++- drivers/mtd/ubi/ubi.h | 45 +++--- 6 files changed, 498 insertions(+), 59 deletions(-) -- 2.39.2