From patchwork Wed Nov 8 08:02:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hou Tao X-Patchwork-Id: 10047907 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 65A376032D for ; Wed, 8 Nov 2017 07:57:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 57FA42A4FB for ; Wed, 8 Nov 2017 07:57:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4CC032A500; Wed, 8 Nov 2017 07:57:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0AE602A4FB for ; Wed, 8 Nov 2017 07:57:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751188AbdKHH5K (ORCPT ); Wed, 8 Nov 2017 02:57:10 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:53835 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751056AbdKHH5I (ORCPT ); Wed, 8 Nov 2017 02:57:08 -0500 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 52E509049C326; Wed, 8 Nov 2017 15:56:55 +0800 (CST) Received: from huawei.com (10.175.124.28) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.361.1; Wed, 8 Nov 2017 15:56:13 +0800 From: Hou Tao To: CC: , , , Subject: [PATCH v2 1/4] dmflakey: support multiple dm targets for a dm-flakey device Date: Wed, 8 Nov 2017 16:02:47 +0800 Message-ID: <20171108080250.5662-2-houtao1@huawei.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20171108080250.5662-1-houtao1@huawei.com> References: <20171108080250.5662-1-houtao1@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.124.28] X-CFilter-Loop: Reflected Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP dm-flakey can be used to emulate IO write error, however, when we also need to prevent the IO error for a specific range of the block device (eg., the log region of a XFS), we need to specify multiple dm targets for the dm device. Option --table can not accommodate the multiple dm targets case, so let dmsetup get the possible-multiple-targets table from standard input. Signed-off-by: Hou Tao --- common/dmflakey | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/dmflakey b/common/dmflakey index 4434307..16b82d2 100644 --- a/common/dmflakey +++ b/common/dmflakey @@ -77,7 +77,7 @@ _load_flakey_table() $DMSETUP_PROG suspend $suspend_opt flakey-test [ $? -ne 0 ] && _fatal "failed to suspend flakey-test" - $DMSETUP_PROG load flakey-test --table "$table" + echo -e "$table" | $DMSETUP_PROG load flakey-test [ $? -ne 0 ] && _fatal "failed to load table into flakey-test" $DMSETUP_PROG resume flakey-test