diff mbox series

[1/3] xfs/504: Add scratch_mount before checking for xfs_scrub unicode support.

Message ID 20210628085259.120666-2-anju@linux.vnet.ibm.com (mailing list archive)
State New, archived
Headers show
Series xfstest random fixes | expand

Commit Message

Anju T Sudhakar June 28, 2021, 8:52 a.m. UTC
We may not detect the error `Inappropriate ioctl for device`, while running
`$XFS_IO_PROG -c "scrub probe" "$mountpoint"`, if scratch device is not
mounted before invoking _check_xfs_scrub_does_unicode(). So do
_scratch_mount before checking for xfs_scrub support.

Signed-off-by: Anju T Sudhakar <anju@linux.vnet.ibm.com>
---
 tests/xfs/504 | 3 +++
 1 file changed, 3 insertions(+)

Comments

Darrick J. Wong June 28, 2021, 3:43 p.m. UTC | #1
On Mon, Jun 28, 2021 at 02:22:57PM +0530, Anju T Sudhakar wrote:
> We may not detect the error `Inappropriate ioctl for device`, while running
> `$XFS_IO_PROG -c "scrub probe" "$mountpoint"`, if scratch device is not
> mounted before invoking _check_xfs_scrub_does_unicode(). So do
> _scratch_mount before checking for xfs_scrub support.
> 
> Signed-off-by: Anju T Sudhakar <anju@linux.vnet.ibm.com>

Oops, heh, good catch!

Reviewed-by: Darrick J. Wong <djwong@kernel.org>

--D

> ---
>  tests/xfs/504 | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/tests/xfs/504 b/tests/xfs/504
> index 40318314..291ee4e4 100755
> --- a/tests/xfs/504
> +++ b/tests/xfs/504
> @@ -21,8 +21,11 @@ _require_xfs_io_command 'label'
>  
>  echo "Silence is golden."
>  
> +_scratch_mkfs > /dev/null
> +_scratch_mount
>  want_scrub=
>  _check_xfs_scrub_does_unicode "$SCRATCH_MNT" "$SCRATCH_DEV" && want_scrub=yes
> +_scratch_unmount
>  
>  filter_scrub() {
>  	grep 'Unicode' | sed -e 's/^.*Duplicate/Duplicate/g'
> -- 
> 2.31.1
>
diff mbox series

Patch

diff --git a/tests/xfs/504 b/tests/xfs/504
index 40318314..291ee4e4 100755
--- a/tests/xfs/504
+++ b/tests/xfs/504
@@ -21,8 +21,11 @@  _require_xfs_io_command 'label'
 
 echo "Silence is golden."
 
+_scratch_mkfs > /dev/null
+_scratch_mount
 want_scrub=
 _check_xfs_scrub_does_unicode "$SCRATCH_MNT" "$SCRATCH_DEV" && want_scrub=yes
+_scratch_unmount
 
 filter_scrub() {
 	grep 'Unicode' | sed -e 's/^.*Duplicate/Duplicate/g'