summaryrefslogtreecommitdiff
path: root/common/xfs
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2021-03-30 18:08:15 -0700
committerEryu Guan <guaneryu@gmail.com>2021-04-11 21:22:56 +0800
commite3b376a1680e5b646f9aef72b0fa8aa1a7feaa51 (patch)
treece223e5e9e996fa02f8b0b6d22bc89fdd81b24d8 /common/xfs
parent3750c2698d93e477aa3e2a5d5d4b759b16080cd2 (diff)
common/xfs: work around a hang-on-stdin bug in xfs_admin 5.11
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> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Diffstat (limited to 'common/xfs')
-rw-r--r--common/xfs8
1 files changed, 7 insertions, 1 deletions
diff --git a/common/xfs b/common/xfs
index 6e1e661a..887bd001 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()