Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp4809219rwb; Sun, 13 Nov 2022 14:27:05 -0800 (PST) X-Google-Smtp-Source: AA0mqf6yrxyFcXlk3aYWJeOJGQxGJCtepBpDcZkzGG7O8QDPZjYNpvH7QdorhthmTglh8ExLH/O8 X-Received: by 2002:a17:902:7d97:b0:179:ee39:e300 with SMTP id a23-20020a1709027d9700b00179ee39e300mr11502134plm.58.1668378425644; Sun, 13 Nov 2022 14:27:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668378425; cv=none; d=google.com; s=arc-20160816; b=09AzRiQGC1A5C7try/bY94JLJGjbNjYalfn5KdPsNLrqxo4DbxLSw6WEGUhAvJsevW Jg2WenBOo8SeCEXb35Rhjvp3p98kqSp1iwR10pjGWiTU4MU9QL5cN+I0JdhVBrpMpHP+ t7VxzNiRsLPjcmH7EgiOBz+/8Os1kWk+51xNfiuBAtx2FWY8eDGB8wBlFCi02mC3JTp4 5P9BdxkafU5+JXz24rEFYkRwLtoVtPD25xT6UwGuBKUpyal055Vucrt4jpZg24/ztgWx igN5Lq+/ioLTaDESvPz73aDyp61mXHHE5NonpuNJean+iafhlinJP3kJDdRtYlF/6tsn o0EQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:reply-to:user-agent :mime-version:date:message-id; bh=jYfGVtYvF8Hr9+ftnZdyvm38iwxdi63VGDTUaxip5Ys=; b=A2KAgFh0ZupGpMqoHSZLmL1gR+dB9Z6Yg0a55iESpYBFMTNQkgks/LqK3Lc8XBR4Sv ooYgVjayxgr9kT0fffaIoUt/Yztr7PCQdDPI/wzjRpgWe0TB5XZ3tqUBA5uAJ1EKruZZ uCtlJs83Y9DOMxrytspVyqCA6wohzdSpL+1mlziqKMi77Q0/NhmMoCG8zETZq3ip3Iid 3Zw/mAO+We5xw+pZEyJrUvOIgLVk8SONH2hcUWh4YNgXATHag5qysUmz4lri1HVAuslr pkLIYOBrZK2504K2xBd5Pef10vWytbB4ZH18PpJb+7rohHgb00rczZR1hvnPaaDQcntJ XjPA== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b3-20020a170902d50300b001869394a38dsi9375417plg.503.2022.11.13.14.26.54; Sun, 13 Nov 2022 14:27:05 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234456AbiKMVsp (ORCPT + 90 others); Sun, 13 Nov 2022 16:48:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229692AbiKMVsn (ORCPT ); Sun, 13 Nov 2022 16:48:43 -0500 Received: from mp-relay-02.fibernetics.ca (mp-relay-02.fibernetics.ca [208.85.217.137]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93CF5DF78; Sun, 13 Nov 2022 13:48:42 -0800 (PST) Received: from mailpool-fe-02.fibernetics.ca (mailpool-fe-02.fibernetics.ca [208.85.217.145]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mp-relay-02.fibernetics.ca (Postfix) with ESMTPS id 3D6BA70E15; Sun, 13 Nov 2022 21:48:40 +0000 (UTC) Received: from localhost (mailpool-mx-02.fibernetics.ca [208.85.217.141]) by mailpool-fe-02.fibernetics.ca (Postfix) with ESMTP id 28E9C60905; Sun, 13 Nov 2022 21:48:40 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at X-Spam-Score: -0.2 X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 Received: from mailpool-fe-02.fibernetics.ca ([208.85.217.145]) by localhost (mail-mx-02.fibernetics.ca [208.85.217.141]) (amavisd-new, port 10024) with ESMTP id bPeFWq1A6s5V; Sun, 13 Nov 2022 21:48:39 +0000 (UTC) Received: from [192.168.5.47] (bras-base-toroon0409w-grc-44-184-147-168-78.dsl.bell.ca [184.147.168.78]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: dgilbert@interlog.com) by mail.ca.inter.net (Postfix) with ESMTPSA id 1A57860112; Sun, 13 Nov 2022 21:48:38 +0000 (UTC) Message-ID: <58472d12-c1e4-59f3-bb37-a98db17ef2ba@interlog.com> Date: Sun, 13 Nov 2022 16:48:35 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Reply-To: dgilbert@interlog.com Subject: Re: [RFC PATCH 0/5] scsi:scsi_debug:Add error injection for single lun To: Wenchao Hao , "James E . J . Bottomley" , "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org References: <20221109155950.3536976-1-haowenchao@huawei.com> Content-Language: en-CA From: Douglas Gilbert In-Reply-To: <20221109155950.3536976-1-haowenchao@huawei.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 On 2022-11-09 10:59, Wenchao Hao wrote: > The original error injection mechanism was based on scsi_host which > could not inject fault for a single SCSI device. > > This patchset provides the ability to inject errors for a single > SCSI device. Now we supports inject timeout errors, queuecommand > errors, and hostbyte, driverbyte, statusbyte, and sense data for > specific SCSI Command > > The first patch add an sysfs interface to add and inquiry single > device's error injection info; the second patch defined how to remove > an injection which has been added. The following 3 patches use the > injection info and generate the related error type. > > Wenchao Hao (5): > scsi:scsi_debug: Add sysfs interface to manager single devices' error inject > scsi:scsi_debug: Add interface to remove injection which has been added > scsi:scsi_debug: make command timeout if timeout error is injected > scsi:scsi_debug: Return failed value for specific command's queuecommand > scsi:scsi_debug: fail specific scsi command with result and sense data > > drivers/scsi/scsi_debug.c | 295 ++++++++++++++++++++++++++++++++++++++ > 1 file changed, 295 insertions(+) Hi, This patchset seems to assume all scsi_debug devices will be disk (-like) SCSI devices. That leaves out other device types: tapes, enclosures, WLUNs, etc. Have you considered putting these device specific additions under: /sys/class/scsi_device//device/error_inject/ instead of /sys/block/sdb/device/error_inject/ ? Doug Gilbert