diff mbox

[v3,1/4] dmflakey: support multiple dm targets for a dm-flakey device

Message ID 20171109073252.36001-2-houtao1@huawei.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Hou Tao Nov. 9, 2017, 7:32 a.m. UTC
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 <houtao1@huawei.com>
---
 common/dmflakey | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Eryu Guan Nov. 9, 2017, 8:56 a.m. UTC | #1
On Thu, Nov 09, 2017 at 03:32:49PM +0800, Hou Tao wrote:
> 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 <houtao1@huawei.com>
> ---
>  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

Sorry for not bringing this up earlier, but adding some comments would
be good here.

Thanks,
Eryu

>  	[ $? -ne 0 ] && _fatal "failed to load table into flakey-test"
>  
>  	$DMSETUP_PROG resume flakey-test
> -- 
> 2.9.5
> 
> --
> To unsubscribe from this list: send the line "unsubscribe fstests" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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