Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp6559273rwp; Tue, 18 Jul 2023 02:13:21 -0700 (PDT) X-Google-Smtp-Source: APBJJlEZx8XolTW6NmQO9UwkRO9cctUI0NTlzWoeqp62vSWeQtXWuB7Lw2i7L3QdfRR1sWfC/c2O X-Received: by 2002:a05:6a20:12ca:b0:135:8a04:9045 with SMTP id v10-20020a056a2012ca00b001358a049045mr1250842pzg.1.1689671601468; Tue, 18 Jul 2023 02:13:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689671601; cv=none; d=google.com; s=arc-20160816; b=n3/j7A3/wnARe5/1g8GYpL00HW8lMOyqvtL7NP6ezog5T4TNOGScQG+j0eZ2cLWE8m zkEiBEtO7d/YNv8Co/W2IP076Tjw50Rck4GL0d+SNS/OuuV2A844IyVj2/4z3FaHtZ70 fs+i2zB2bT1wsvZfASFyCcZW8nGYEY+qB5DHf/+q4lmc4ztPtsF88J1ooc+2/+x5DhDr hrMR7igEsFzCNXQYjihscO+CrFq/qZA17jvZm225jnyFZIoOGr+VctKCkekyjH1bvUwB ElGVnrPvHxqO1PaD0kE/jMTrDXo//F/lypwLhglXq2czqlMOQa7pXEkxlMu5Gy9vlRWC NITA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=KMzinQMKyKIwtRw7NQG9E41OoGTOq4vi6G8oOZH5iIM=; fh=wVYnlJkdCBQCsPBltOpwRZY1Ob8weyxSizm8alLbX9s=; b=if18eqUPDNXaPVYfKijfqEYbOIabYOGIzCKtlRuzoXNErA2b/KIRSNcWepGgGGo3Ff uE9kB04FnUgfVV3owR3uv14IRrLcAo4pOWwswXX9t0WsgbJLTuunTFskgOL23ALLlTWs HahIu02GKnbRzP5NGC8g4g9wnT+GbKQerFD3Yv2jSfzxw7E52IlQPfeuvNpwGfna8yB7 brFbUeI8FB3JMV8iKTzgWM/h411uZ5SGkA2YlnL/Zn/NDq6J2KAIgjOjhHEsxjvGbRfy JpgiEgYJjxecI/Ud3uVHQeuGinr/j4iGC9mabJQRisDnD+AtAXT9hNUYwTkC5E9ZakaC dj8A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f14-20020a056a00228e00b006825b4fae9dsi1272761pfe.166.2023.07.18.02.13.08; Tue, 18 Jul 2023 02:13:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232082AbjGRIyV (ORCPT + 99 others); Tue, 18 Jul 2023 04:54:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231503AbjGRIyP (ORCPT ); Tue, 18 Jul 2023 04:54:15 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3CCF1103 for ; Tue, 18 Jul 2023 01:54:14 -0700 (PDT) Received: from dggpemm500009.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4R4t4y1wXVzVjHh; Tue, 18 Jul 2023 16:52:50 +0800 (CST) Received: from huawei.com (10.175.127.227) by dggpemm500009.china.huawei.com (7.185.36.225) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Tue, 18 Jul 2023 16:54:11 +0800 From: ZhaoLong Wang To: , , CC: , , , , Subject: [PATCH V2 0/5] ubi: Enhanced fault injection capability for the UBI driver Date: Tue, 18 Jul 2023 16:51:14 +0800 Message-ID: <20230718085119.3885747-1-wangzhaolong1@huawei.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.127.227] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemm500009.china.huawei.com (7.185.36.225) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The existing fault injection capability of UBI is too simple. It uses hard-coded fault probability values and lacks other configurable options. As a result, these interfaces are difficult to use when digging defects in the abnormal path of code and reproducing some problems. 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 refactor 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. 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 | 6 +- drivers/mtd/ubi/Kconfig | 9 ++ drivers/mtd/ubi/debug.c | 107 ++++++++++++++-- drivers/mtd/ubi/debug.h | 264 ++++++++++++++++++++++++++++++++++++---- drivers/mtd/ubi/io.c | 85 ++++++++++++- drivers/mtd/ubi/ubi.h | 46 +++---- 6 files changed, 458 insertions(+), 59 deletions(-) -- 2.31.1