From patchwork Thu Oct 26 07:37:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hou Tao X-Patchwork-Id: 10027539 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 0D63260567 for ; Thu, 26 Oct 2017 07:32:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F0B0228D37 for ; Thu, 26 Oct 2017 07:32:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E506628D45; Thu, 26 Oct 2017 07:32:18 +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 9EABE28D37 for ; Thu, 26 Oct 2017 07:32:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751228AbdJZHcR (ORCPT ); Thu, 26 Oct 2017 03:32:17 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:9507 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751166AbdJZHcR (ORCPT ); Thu, 26 Oct 2017 03:32:17 -0400 Received: from 172.30.72.59 (EHLO DGGEMS410-HUB.china.huawei.com) ([172.30.72.59]) by dggrg05-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id DJY42462; Thu, 26 Oct 2017 15:32:02 +0800 (CST) Received: from huawei.com (10.175.124.28) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.361.1; Thu, 26 Oct 2017 15:31:34 +0800 From: Hou Tao To: CC: , , Subject: [PATCH 1/2] dmflakey: support multiple dm targets for a dm-flakey device Date: Thu, 26 Oct 2017 15:37:51 +0800 Message-ID: <1509003472-24191-1-git-send-email-houtao1@huawei.com> X-Mailer: git-send-email 2.7.5 MIME-Version: 1.0 X-Originating-IP: [10.175.124.28] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A010205.59F18F72.000E, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 49f2868d54f1edf58531c9dc2769deb5 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 is used to emulate IO 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