Linux-XFS Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v2] generic/050: fix xfsquota configuration failures
@ 2019-11-27 16:34 Darrick J. Wong
  2019-11-28 11:01 ` Jan Kara
  2019-12-01  3:35 ` Eryu Guan
  0 siblings, 2 replies; 3+ messages in thread
From: Darrick J. Wong @ 2019-11-27 16:34 UTC (permalink / raw)
  To: Eryu Guan; +Cc: fstests, xfs, Jan Kara

From: Darrick J. Wong <darrick.wong@oracle.com>

The new 'xfsquota' configuration for generic/050 doesn't filter out
SCRATCH_MNT properly and seems to be missing an error message in the
golden output.  Fix both of these problems.

Fixes: e088479871 ("generic/050: Handle xfs quota special case with different output")
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
v2: don't try the touch if the mount fails
---
 tests/generic/050              |   12 +++++++-----
 tests/generic/050.out.xfsquota |    5 ++---
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/tests/generic/050 b/tests/generic/050
index cf2b9381..7eabc7a7 100755
--- a/tests/generic/050
+++ b/tests/generic/050
@@ -58,9 +58,11 @@ blockdev --setro $SCRATCH_DEV
 # Mount it, and make sure we can't write to it, and we can unmount it again
 #
 echo "mounting read-only block device:"
-_try_scratch_mount 2>&1 | _filter_ro_mount
-echo "touching file on read-only filesystem (should fail)"
-touch $SCRATCH_MNT/foo 2>&1 | _filter_scratch
+_try_scratch_mount 2>&1 | _filter_ro_mount | _filter_scratch
+if [ "${PIPESTATUS[0]}" -eq 0 ]; then
+	echo "touching file on read-only filesystem (should fail)"
+	touch $SCRATCH_MNT/foo 2>&1 | _filter_scratch
+fi
 
 #
 # Apparently this used to be broken at some point:
@@ -92,7 +94,7 @@ blockdev --setro $SCRATCH_DEV
 # -o norecovery is used.
 #
 echo "mounting filesystem that needs recovery on a read-only device:"
-_try_scratch_mount 2>&1 | _filter_ro_mount
+_try_scratch_mount 2>&1 | _filter_ro_mount | _filter_scratch
 
 echo "unmounting read-only filesystem"
 _scratch_unmount 2>&1 | _filter_scratch | _filter_ending_dot
@@ -103,7 +105,7 @@ _scratch_unmount 2>&1 | _filter_scratch | _filter_ending_dot
 # data recovery hack.
 #
 echo "mounting filesystem with -o norecovery on a read-only device:"
-_try_scratch_mount -o norecovery 2>&1 | _filter_ro_mount
+_try_scratch_mount -o norecovery 2>&1 | _filter_ro_mount | _filter_scratch
 echo "unmounting read-only filesystem"
 _scratch_unmount 2>&1 | _filter_scratch | _filter_ending_dot
 
diff --git a/tests/generic/050.out.xfsquota b/tests/generic/050.out.xfsquota
index f204bd2f..35d7bd68 100644
--- a/tests/generic/050.out.xfsquota
+++ b/tests/generic/050.out.xfsquota
@@ -1,8 +1,7 @@
 QA output created by 050
 setting device read-only
 mounting read-only block device:
-mount: /mnt-scratch: permission denied
-touching file on read-only filesystem (should fail)
+mount: SCRATCH_MNT: permission denied
 unmounting read-only filesystem
 umount: SCRATCH_DEV: not mounted
 setting device read-write
@@ -17,7 +16,7 @@ mount: cannot mount device read-only
 unmounting read-only filesystem
 umount: SCRATCH_DEV: not mounted
 mounting filesystem with -o norecovery on a read-only device:
-mount: /mnt-scratch: permission denied
+mount: SCRATCH_MNT: permission denied
 unmounting read-only filesystem
 umount: SCRATCH_DEV: not mounted
 setting device read-write

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] generic/050: fix xfsquota configuration failures
  2019-11-27 16:34 [PATCH v2] generic/050: fix xfsquota configuration failures Darrick J. Wong
@ 2019-11-28 11:01 ` Jan Kara
  2019-12-01  3:35 ` Eryu Guan
  1 sibling, 0 replies; 3+ messages in thread
From: Jan Kara @ 2019-11-28 11:01 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Eryu Guan, fstests, xfs, Jan Kara

On Wed 27-11-19 08:34:57, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> The new 'xfsquota' configuration for generic/050 doesn't filter out
> SCRATCH_MNT properly and seems to be missing an error message in the
> golden output.  Fix both of these problems.
> 
> Fixes: e088479871 ("generic/050: Handle xfs quota special case with different output")
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

Thanks! The patch looks good to me. You can add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> ---
> v2: don't try the touch if the mount fails
> ---
>  tests/generic/050              |   12 +++++++-----
>  tests/generic/050.out.xfsquota |    5 ++---
>  2 files changed, 9 insertions(+), 8 deletions(-)
> 
> diff --git a/tests/generic/050 b/tests/generic/050
> index cf2b9381..7eabc7a7 100755
> --- a/tests/generic/050
> +++ b/tests/generic/050
> @@ -58,9 +58,11 @@ blockdev --setro $SCRATCH_DEV
>  # Mount it, and make sure we can't write to it, and we can unmount it again
>  #
>  echo "mounting read-only block device:"
> -_try_scratch_mount 2>&1 | _filter_ro_mount
> -echo "touching file on read-only filesystem (should fail)"
> -touch $SCRATCH_MNT/foo 2>&1 | _filter_scratch
> +_try_scratch_mount 2>&1 | _filter_ro_mount | _filter_scratch
> +if [ "${PIPESTATUS[0]}" -eq 0 ]; then
> +	echo "touching file on read-only filesystem (should fail)"
> +	touch $SCRATCH_MNT/foo 2>&1 | _filter_scratch
> +fi
>  
>  #
>  # Apparently this used to be broken at some point:
> @@ -92,7 +94,7 @@ blockdev --setro $SCRATCH_DEV
>  # -o norecovery is used.
>  #
>  echo "mounting filesystem that needs recovery on a read-only device:"
> -_try_scratch_mount 2>&1 | _filter_ro_mount
> +_try_scratch_mount 2>&1 | _filter_ro_mount | _filter_scratch
>  
>  echo "unmounting read-only filesystem"
>  _scratch_unmount 2>&1 | _filter_scratch | _filter_ending_dot
> @@ -103,7 +105,7 @@ _scratch_unmount 2>&1 | _filter_scratch | _filter_ending_dot
>  # data recovery hack.
>  #
>  echo "mounting filesystem with -o norecovery on a read-only device:"
> -_try_scratch_mount -o norecovery 2>&1 | _filter_ro_mount
> +_try_scratch_mount -o norecovery 2>&1 | _filter_ro_mount | _filter_scratch
>  echo "unmounting read-only filesystem"
>  _scratch_unmount 2>&1 | _filter_scratch | _filter_ending_dot
>  
> diff --git a/tests/generic/050.out.xfsquota b/tests/generic/050.out.xfsquota
> index f204bd2f..35d7bd68 100644
> --- a/tests/generic/050.out.xfsquota
> +++ b/tests/generic/050.out.xfsquota
> @@ -1,8 +1,7 @@
>  QA output created by 050
>  setting device read-only
>  mounting read-only block device:
> -mount: /mnt-scratch: permission denied
> -touching file on read-only filesystem (should fail)
> +mount: SCRATCH_MNT: permission denied
>  unmounting read-only filesystem
>  umount: SCRATCH_DEV: not mounted
>  setting device read-write
> @@ -17,7 +16,7 @@ mount: cannot mount device read-only
>  unmounting read-only filesystem
>  umount: SCRATCH_DEV: not mounted
>  mounting filesystem with -o norecovery on a read-only device:
> -mount: /mnt-scratch: permission denied
> +mount: SCRATCH_MNT: permission denied
>  unmounting read-only filesystem
>  umount: SCRATCH_DEV: not mounted
>  setting device read-write
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] generic/050: fix xfsquota configuration failures
  2019-11-27 16:34 [PATCH v2] generic/050: fix xfsquota configuration failures Darrick J. Wong
  2019-11-28 11:01 ` Jan Kara
@ 2019-12-01  3:35 ` Eryu Guan
  1 sibling, 0 replies; 3+ messages in thread
From: Eryu Guan @ 2019-12-01  3:35 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: fstests, xfs, Jan Kara

On Wed, Nov 27, 2019 at 08:34:57AM -0800, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> The new 'xfsquota' configuration for generic/050 doesn't filter out
> SCRATCH_MNT properly and seems to be missing an error message in the
> golden output.  Fix both of these problems.
> 
> Fixes: e088479871 ("generic/050: Handle xfs quota special case with different output")
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

Thanks for the fix! And sorry for not noticing such test failure. I did
test xfs/050 but apparently I forget to enable xfsquota..

Thanks!
Eryu
> ---
> v2: don't try the touch if the mount fails
> ---
>  tests/generic/050              |   12 +++++++-----
>  tests/generic/050.out.xfsquota |    5 ++---
>  2 files changed, 9 insertions(+), 8 deletions(-)
> 
> diff --git a/tests/generic/050 b/tests/generic/050
> index cf2b9381..7eabc7a7 100755
> --- a/tests/generic/050
> +++ b/tests/generic/050
> @@ -58,9 +58,11 @@ blockdev --setro $SCRATCH_DEV
>  # Mount it, and make sure we can't write to it, and we can unmount it again
>  #
>  echo "mounting read-only block device:"
> -_try_scratch_mount 2>&1 | _filter_ro_mount
> -echo "touching file on read-only filesystem (should fail)"
> -touch $SCRATCH_MNT/foo 2>&1 | _filter_scratch
> +_try_scratch_mount 2>&1 | _filter_ro_mount | _filter_scratch
> +if [ "${PIPESTATUS[0]}" -eq 0 ]; then
> +	echo "touching file on read-only filesystem (should fail)"
> +	touch $SCRATCH_MNT/foo 2>&1 | _filter_scratch
> +fi
>  
>  #
>  # Apparently this used to be broken at some point:
> @@ -92,7 +94,7 @@ blockdev --setro $SCRATCH_DEV
>  # -o norecovery is used.
>  #
>  echo "mounting filesystem that needs recovery on a read-only device:"
> -_try_scratch_mount 2>&1 | _filter_ro_mount
> +_try_scratch_mount 2>&1 | _filter_ro_mount | _filter_scratch
>  
>  echo "unmounting read-only filesystem"
>  _scratch_unmount 2>&1 | _filter_scratch | _filter_ending_dot
> @@ -103,7 +105,7 @@ _scratch_unmount 2>&1 | _filter_scratch | _filter_ending_dot
>  # data recovery hack.
>  #
>  echo "mounting filesystem with -o norecovery on a read-only device:"
> -_try_scratch_mount -o norecovery 2>&1 | _filter_ro_mount
> +_try_scratch_mount -o norecovery 2>&1 | _filter_ro_mount | _filter_scratch
>  echo "unmounting read-only filesystem"
>  _scratch_unmount 2>&1 | _filter_scratch | _filter_ending_dot
>  
> diff --git a/tests/generic/050.out.xfsquota b/tests/generic/050.out.xfsquota
> index f204bd2f..35d7bd68 100644
> --- a/tests/generic/050.out.xfsquota
> +++ b/tests/generic/050.out.xfsquota
> @@ -1,8 +1,7 @@
>  QA output created by 050
>  setting device read-only
>  mounting read-only block device:
> -mount: /mnt-scratch: permission denied
> -touching file on read-only filesystem (should fail)
> +mount: SCRATCH_MNT: permission denied
>  unmounting read-only filesystem
>  umount: SCRATCH_DEV: not mounted
>  setting device read-write
> @@ -17,7 +16,7 @@ mount: cannot mount device read-only
>  unmounting read-only filesystem
>  umount: SCRATCH_DEV: not mounted
>  mounting filesystem with -o norecovery on a read-only device:
> -mount: /mnt-scratch: permission denied
> +mount: SCRATCH_MNT: permission denied
>  unmounting read-only filesystem
>  umount: SCRATCH_DEV: not mounted
>  setting device read-write

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-27 16:34 [PATCH v2] generic/050: fix xfsquota configuration failures Darrick J. Wong
2019-11-28 11:01 ` Jan Kara
2019-12-01  3:35 ` Eryu Guan

Linux-XFS Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-xfs/0 linux-xfs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-xfs linux-xfs/ https://lore.kernel.org/linux-xfs \
		linux-xfs@vger.kernel.org
	public-inbox-index linux-xfs

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-xfs


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git