Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp942rdg; Tue, 10 Oct 2023 02:21:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGx3y22sG8SFaf78M8hZVdhxcENuzJ1AQQX14+xZ4/keHZoV00fF4yB7UqT+k3fcjpsh0Xa X-Received: by 2002:a17:902:6b82:b0:1bc:2abb:4e98 with SMTP id p2-20020a1709026b8200b001bc2abb4e98mr15959830plk.21.1696929707779; Tue, 10 Oct 2023 02:21:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696929707; cv=none; d=google.com; s=arc-20160816; b=HlD8wJXzk1Y7D2jjf/2U8Zh2BENSutrzyXyTK/YkugbLiIu+1Nq/mUj+KURxXhRcCK BHoCHIPSeGg59nOedeSjGI9W97lui0GviIboaeRIekl8bW+Mn7lCzr1rsokuc9R0h4vZ s7H/1CYPkqWVG5p4lnd+C1uixeyQKyNe6iJzYf7wVl5kXk9WZaGITPsLW/k34/jb/raF JgK+vpCiWjtdQVZuUbkYb8tjh5sW/hRoPMsgyRsAc1hSb8U6uCK70ETzvfL6fK2+rcX9 7tF3pzxZz0hZI0uMIeNds5pDSUWatduwDicNkAz/4BbkWI+F+bcUx5fkij7Rx5vt3Jij lqug== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=Y41WRrE6ZBhAugTvioxSKe1jMjgvhZ1xvhkZONZkuJg=; fh=Bw74vauKC02eaEbQr8FoniTYtc//6dp3BvPBLCS/H3M=; b=09y/QAqtN03jR0BpnUO16DnhK8XBQg2ghrPZ9xLHwQP+an3YREaIG41FeJFqGBnbqJ +JexBFY3ifcvPQTBJhyBqSqEHdGy5+5pXUTDV6Z1hLC3pHnvTfRwkn8MDLVvgfQJdMPq iH9bOD+NldMwH9p3ojqORP8p0Nek0bmyvgIj4MWDrKFmKKyWk0/A77S5aOSGKQu2vHDK XPUs7cZY7CFNL15oCu1ffFiCKDdozpe46JTLveuOSmRCkP7hXIxX75wSHM5xs4JWWffF 0DrFIBFCDTwsiVTtgo/KkTDdPSYKHFol3MhUO+esDCsiskVMot2gcrTd7V1oJ/1+Lw1j Ah4g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id f5-20020a170902684500b001bef085a37dsi11163022pln.86.2023.10.10.02.21.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 02:21:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 96835813A592; Tue, 10 Oct 2023 02:21:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229868AbjJJJVW (ORCPT + 99 others); Tue, 10 Oct 2023 05:21:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229517AbjJJJVW (ORCPT ); Tue, 10 Oct 2023 05:21:22 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74A3DA4; Tue, 10 Oct 2023 02:21:20 -0700 (PDT) Received: from kwepemm000012.china.huawei.com (unknown [172.30.72.55]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4S4Vh64v2Kz1M9CX; Tue, 10 Oct 2023 17:18:46 +0800 (CST) Received: from build.huawei.com (10.175.101.6) by kwepemm000012.china.huawei.com (7.193.23.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Tue, 10 Oct 2023 17:21:18 +0800 From: Wenchao Hao To: "Martin K . Petersen" , Douglas Gilbert CC: "James E . J . Bottomley" , , , , Wenchao Hao Subject: [PATCH v6 01/10] scsi: scsi_debug: create scsi_debug directory in the debugfs filesystem Date: Tue, 10 Oct 2023 17:20:42 +0800 Message-ID: <20231010092051.608007-2-haowenchao2@huawei.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20231010092051.608007-1-haowenchao2@huawei.com> References: <20231010092051.608007-1-haowenchao2@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.101.6] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemm000012.china.huawei.com (7.193.23.142) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 10 Oct 2023 02:21:25 -0700 (PDT) Create directory scsi_debug in the root of the debugfs filesystem. Prepare to add interface for manage error injection. Acked-by: Douglas Gilbert Signed-off-by: Wenchao Hao --- drivers/scsi/scsi_debug.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 9c0af50501f9..562a48f53cda 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c @@ -41,6 +41,7 @@ #include #include #include +#include #include @@ -862,6 +863,8 @@ static const int device_qfull_result = static const int condition_met_result = SAM_STAT_CONDITION_MET; +static struct dentry *sdebug_debugfs_root; + /* Only do the extra work involved in logical block provisioning if one or * more of the lbpu, lbpws or lbpws10 parameters are given and we are doing @@ -7011,6 +7014,10 @@ static int __init scsi_debug_init(void) goto driver_unreg; } + sdebug_debugfs_root = debugfs_create_dir("scsi_debug", NULL); + if (IS_ERR_OR_NULL(sdebug_debugfs_root)) + pr_info("%s: failed to create initial debugfs directory\n", __func__); + for (k = 0; k < hosts_to_add; k++) { if (want_store && k == 0) { ret = sdebug_add_host_helper(idx); @@ -7057,6 +7064,7 @@ static void __exit scsi_debug_exit(void) sdebug_erase_all_stores(false); xa_destroy(per_store_ap); + debugfs_remove(sdebug_debugfs_root); } device_initcall(scsi_debug_init); -- 2.32.0