aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmir Goldstein <amir73il@gmail.com>2016-12-08 12:52:20 +0200
committerEryu Guan <eguan@redhat.com>2016-12-09 15:55:19 +0800
commit53d31765f607735a055dad7423924584b347aee8 (patch)
tree88ac5c1459ebd4b35edea6c69e87c0e4d3f91a56
parent180843c1f468025749af2d7c171e3f57075b8459 (diff)
downloadxfstests-dev-53d31765f607735a055dad7423924584b347aee8.tar.gz
common: implement _require_xfs_io_command "open"
-c "open $f" is broken in xfs_io <= 4.8. Using it results in an endless loop and xfs_io exists with error EMFILE. A fix for that bug makes "open" a 'one shot' command. Along with this fix, a new -C flag was introduced to explicitly request to execute a one shot command. Check for -C flag support as an indication that -c "open $f" is not broken. Signed-off-by: Amir Goldstein <amir73il@gmail.com> Reviewed-by: Eryu Guan <eguan@redhat.com> Signed-off-by: Eryu Guan <eguan@redhat.com>
-rw-r--r--common/rc8
1 files changed, 8 insertions, 0 deletions
diff --git a/common/rc b/common/rc
index 6d9694f741..2639fbdab5 100644
--- a/common/rc
+++ b/common/rc
@@ -1758,6 +1758,14 @@ _require_xfs_io_command()
echo $testio | egrep -q "Inappropriate ioctl" && \
_notrun "xfs_io $command support is missing"
;;
+ "open")
+ # -c "open $f" is broken in xfs_io <= 4.8. Along with the fix,
+ # a new -C flag was introduced to execute one shot commands.
+ # Check for -C flag support as an indication for the bug fix.
+ testio=`$XFS_IO_PROG -F -f -C "open $testfile" $testfile 2>&1`
+ echo $testio | egrep -q "invalid option" && \
+ _notrun "xfs_io $command support is missing"
+ ;;
*)
testio=`$XFS_IO_PROG -c "$command help" 2>&1`
esac