diff mbox series

[3/4] dmflakey: don't run dmflakey tests with an external log device

Message ID 20220720164356.4078789-4-tytso@mit.edu (mailing list archive)
State New, archived
Headers show
Series fstests: more random fixes from Ted | expand

Commit Message

Theodore Ts'o July 20, 2022, 4:43 p.m. UTC
dmflakey works by dropping all writes before unmounting to simulate a
crash/power loss.  This doesn't work if there is an external log
device, since we only drop writes to the primary block device, and not
the external log device.  Fixing this for real would require somehow
arranging to atomically loading a new dmflakey table for two block
devices at the same time, so for now, just skip tests using dmflakey
if the external log device is enabled.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
---
 common/dmflakey | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Darrick J. Wong July 20, 2022, 5:35 p.m. UTC | #1
On Wed, Jul 20, 2022 at 12:43:55PM -0400, Theodore Ts'o wrote:
> dmflakey works by dropping all writes before unmounting to simulate a
> crash/power loss.  This doesn't work if there is an external log
> device, since we only drop writes to the primary block device, and not
> the external log device.  Fixing this for real would require somehow
> arranging to atomically loading a new dmflakey table for two block
> devices at the same time, so for now, just skip tests using dmflakey
> if the external log device is enabled.
> 
> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
> ---
>  common/dmflakey | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/common/dmflakey b/common/dmflakey
> index 52da3b10..c2be78e9 100644
> --- a/common/dmflakey
> +++ b/common/dmflakey
> @@ -12,6 +12,10 @@ _init_flakey()
>  {
>  	# Scratch device
>  	local BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV`
> +
> +	if test "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ; then
> +		_notrun "dmflakey tests don't work with an external log device"
> +	fi

I'm kinda surprised this still doesn't work -- last year Eryu merged a
patch[1] from me that's supposed to make common/dmflakey work with
external log devices.  What kind of failures do you see?

--D

[1] 9c1f3149 ("dmflakey: support external log and realtime devices")

>  	FLAKEY_DEV=/dev/mapper/flakey-test
>  	FLAKEY_TABLE="0 $BLK_DEV_SIZE flakey $SCRATCH_DEV 0 180 0"
>  	FLAKEY_TABLE_DROP="0 $BLK_DEV_SIZE flakey $SCRATCH_DEV 0 0 180 1 drop_writes"
> -- 
> 2.31.0
>
diff mbox series

Patch

diff --git a/common/dmflakey b/common/dmflakey
index 52da3b10..c2be78e9 100644
--- a/common/dmflakey
+++ b/common/dmflakey
@@ -12,6 +12,10 @@  _init_flakey()
 {
 	# Scratch device
 	local BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV`
+
+	if test "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ; then
+		_notrun "dmflakey tests don't work with an external log device"
+	fi
 	FLAKEY_DEV=/dev/mapper/flakey-test
 	FLAKEY_TABLE="0 $BLK_DEV_SIZE flakey $SCRATCH_DEV 0 180 0"
 	FLAKEY_TABLE_DROP="0 $BLK_DEV_SIZE flakey $SCRATCH_DEV 0 0 180 1 drop_writes"