diff mbox

xfs/010: explicitly allow corrupted write in xfs_db

Message ID 9d52a01a-78db-3ee1-66e7-bddd1f3f9598@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Eric Sandeen Jan. 9, 2017, 4:49 p.m. UTC
xfs/010 wants to write corruption and test how xfs_repair
deals, but when:

  xfs: forbid AG btrees with level == 0

is merged to userspace, this new test fails the write verifier
in xfs_db.

Add "-c" to allow the corrupted write, do the corruptions all
in one xfs_db command (so it doesn't have to re-read the
corrupted data on 2nd startup), and filter out the

  "Allowing write of corrupted data and bad CRC"

output from the "write -c" command.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---


--
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

Comments

Brian Foster Jan. 9, 2017, 5:04 p.m. UTC | #1
On Mon, Jan 09, 2017 at 10:49:21AM -0600, Eric Sandeen wrote:
> xfs/010 wants to write corruption and test how xfs_repair
> deals, but when:
> 
>   xfs: forbid AG btrees with level == 0
> 
> is merged to userspace, this new test fails the write verifier
> in xfs_db.
> 
> Add "-c" to allow the corrupted write, do the corruptions all
> in one xfs_db command (so it doesn't have to re-read the
> corrupted data on 2nd startup), and filter out the
> 
>   "Allowing write of corrupted data and bad CRC"
> 
> output from the "write -c" command.
> 
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---

Reviewed-by: Brian Foster <bfoster@redhat.com>

> 
> diff --git a/tests/xfs/010 b/tests/xfs/010
> index d350d64..471ec2c 100755
> --- a/tests/xfs/010
> +++ b/tests/xfs/010
> @@ -95,8 +95,11 @@ _corrupt_finobt_root()
>  	dev=$1
>  
>  	# nuke the agi finobt root fields
> -	$XFS_DB_PROG -x -c "agi 0" -c "write free_root 0" $dev
> -	$XFS_DB_PROG -x -c "agi 0" -c "write free_level 0" $dev
> +	$XFS_DB_PROG -x				\
> +		-c "agi 0"			\
> +		-c "write -c free_root 0"	\
> +		-c "write -c free_level 0"	\
> +		$dev | grep -v "Allowing write of corrupted"
>  }
>  
>  # real QA test starts here
> 
> --
> 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 fstests" 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/tests/xfs/010 b/tests/xfs/010
index d350d64..471ec2c 100755
--- a/tests/xfs/010
+++ b/tests/xfs/010
@@ -95,8 +95,11 @@  _corrupt_finobt_root()
 	dev=$1
 
 	# nuke the agi finobt root fields
-	$XFS_DB_PROG -x -c "agi 0" -c "write free_root 0" $dev
-	$XFS_DB_PROG -x -c "agi 0" -c "write free_level 0" $dev
+	$XFS_DB_PROG -x				\
+		-c "agi 0"			\
+		-c "write -c free_root 0"	\
+		-c "write -c free_level 0"	\
+		$dev | grep -v "Allowing write of corrupted"
 }
 
 # real QA test starts here