From: Brian Foster <bfoster@redhat.com>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: guaneryu@gmail.com, linux-xfs@vger.kernel.org,
fstests@vger.kernel.org, guan@eryu.me
Subject: Re: [PATCH 2/3] common/xfs: work around a hang-on-stdin bug in xfs_admin 5.11
Date: Wed, 31 Mar 2021 12:39:12 -0400 [thread overview]
Message-ID: <YGSlsLpZKtXYhV4b@bfoster> (raw)
In-Reply-To: <161715289578.2703773.11659648563859531836.stgit@magnolia>
On Tue, Mar 30, 2021 at 06:08:15PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
>
> xfs_admin in xfsprogs 5.11 has a bug wherein a caller who specifies an
> external log device forces xfs_db to be invoked, potentially with zero
> command arguments. When this happens, xfs_db will wait for input on
> stdin, which causes fstests to hang. Since xfs_admin is not an
> interactive tool, redirect stdin from /dev/null to prevent this issue.
>
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> ---
Reviewed-by: Brian Foster <bfoster@redhat.com>
> common/xfs | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
>
> diff --git a/common/xfs b/common/xfs
> index 189da54b..c97e08ba 100644
> --- a/common/xfs
> +++ b/common/xfs
> @@ -277,7 +277,13 @@ _scratch_xfs_admin()
> _notrun 'xfs_admin does not support rt devices'
> rt_opts+=(-r "$SCRATCH_RTDEV")
> fi
> - $XFS_ADMIN_PROG "${rt_opts[@]}" "$@" "${options[@]}"
> +
> + # xfs_admin in xfsprogs 5.11 has a bug where an external log device
> + # forces xfs_db to be invoked, potentially with zero command arguments.
> + # When this happens, xfs_db will wait for input on stdin, which causes
> + # fstests to hang. Since xfs_admin is not an interactive tool, we
> + # can redirect stdin from /dev/null to prevent this issue.
> + $XFS_ADMIN_PROG "${rt_opts[@]}" "$@" "${options[@]}" < /dev/null
> }
>
> _scratch_xfs_logprint()
>
next prev parent reply other threads:[~2021-03-31 16:40 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-31 1:08 [PATCHSET v3 0/3] fstests: make sure NEEDSREPAIR feature stops mounts Darrick J. Wong
2021-03-31 1:08 ` [PATCH 1/3] common/xfs: support realtime devices with _scratch_xfs_admin Darrick J. Wong
2021-03-31 16:39 ` Brian Foster
2021-03-31 1:08 ` [PATCH 2/3] common/xfs: work around a hang-on-stdin bug in xfs_admin 5.11 Darrick J. Wong
2021-03-31 16:39 ` Brian Foster [this message]
2021-03-31 1:08 ` [PATCH 3/3] xfs: test that the needsrepair feature works as advertised Darrick J. Wong
2021-03-31 16:41 ` Brian Foster
2021-04-02 1:24 ` Darrick J. Wong
2021-04-05 14:46 ` Brian Foster
2021-04-07 23:20 ` Darrick J. Wong
2021-04-11 13:22 ` Eryu Guan
2021-04-12 17:27 ` Darrick J. Wong
2021-04-12 18:07 ` Brian Foster
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=YGSlsLpZKtXYhV4b@bfoster \
--to=bfoster@redhat.com \
--cc=djwong@kernel.org \
--cc=fstests@vger.kernel.org \
--cc=guan@eryu.me \
--cc=guaneryu@gmail.com \
--cc=linux-xfs@vger.kernel.org \
/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).