fstests.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Eryu Guan <guaneryu@gmail.com>
Cc: Jan Kara <jack@suse.cz>,
	fstests@vger.kernel.org,
	"Darrick J. Wong" <darrick.wong@oracle.com>
Subject: Re: [PATCH 2/2] generic/050: Handle xfs quota special case with different output
Date: Mon, 11 Nov 2019 15:29:26 +0100	[thread overview]
Message-ID: <20191111142926.GD13307@quack2.suse.cz> (raw)
In-Reply-To: <20191110141052.GE8664@desktop>

On Sun 10-11-19 22:10:54, Eryu Guan wrote:
> [cc'ed Darrick for his inputs, if there's any]
> >  fi
> >  _link_out_file "$features"
> >  
> >  _scratch_mkfs >/dev/null 2>&1
> >  
> > -filter_ro_mount() {
> > -	local arg=""
> > -
> > -	if [ -n "$expect_mount_failure" ]; then
> > -		arg="s|mount: $SCRATCH_MNT: permission denied|mount: device write-protected, mounting read-only|g"
> > -	fi
> > -	sed -e "$arg" | _filter_ro_mount
> > -}
> > -
> > -# Mounting with quota on XFS requires a writable fs, which means
> > -# we expect to fail the ro blockdev test with with EPERM.
> > -expect_mount_failure=
> > -if [ "$FSTYP" = "xfs" ] && echo "$MOUNT_OPTIONS" | grep -q quota ; then
> > -	expect_mount_failure=1
> > -fi
> > -
> >  #
> >  # Mark the device read-only
> >  #
> > @@ -70,7 +58,7 @@ 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
> > +_try_scratch_mount 2>&1 | _filter_ro_mount
> >  if [ "${PIPESTATUS[0]}" -eq 0 ]; then
> 
> But I think we could remove above check as a whole, just do
> 
> _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
> echo "unmounting read-only filesystem"
> _scratch_unmount 2>&1 | _filter_scratch
> 
> as what we did prior to commit b0415daaa968 ("generic/050: fix ro
> blockdev mount of xfs with quota").

Your suggestion looks good to me. I'll update the patch, test, and resend.

								Honza


-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

      reply	other threads:[~2019-11-11 14:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-05 13:19 [PATCH 0/2] generic/050 fixes Jan Kara
2019-11-05 13:19 ` [PATCH 1/2] generic/050: Fix test failure for filesystems without journal Jan Kara
2019-11-05 13:19 ` [PATCH 2/2] generic/050: Handle xfs quota special case with different output Jan Kara
2019-11-10 14:10   ` Eryu Guan
2019-11-11 14:29     ` Jan Kara [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191111142926.GD13307@quack2.suse.cz \
    --to=jack@suse.cz \
    --cc=darrick.wong@oracle.com \
    --cc=fstests@vger.kernel.org \
    --cc=guaneryu@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).