public inbox for linux-unionfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: Eryu Guan <eguan@redhat.com>
Cc: Dave Chinner <david@fromorbit.com>,
	fstests@vger.kernel.org, linux-unionfs@vger.kernel.org
Subject: [PATCH 1/2] common: implement _require_xfs_io_command "open"
Date: Thu,  8 Dec 2016 12:52:20 +0200	[thread overview]
Message-ID: <1481194341-3592-1-git-send-email-amir73il@gmail.com> (raw)

-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>
---
 common/rc | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/common/rc b/common/rc
index 2719b23..cd2e8eb 100644
--- a/common/rc
+++ b/common/rc
@@ -1757,6 +1757,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
-- 
2.7.4

             reply	other threads:[~2016-12-08 10:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-08 10:52 Amir Goldstein [this message]
2016-12-08 10:52 ` [PATCH 2/2] overlay/016: use xfs_io -C for executing commands Amir Goldstein

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=1481194341-3592-1-git-send-email-amir73il@gmail.com \
    --to=amir73il@gmail.com \
    --cc=david@fromorbit.com \
    --cc=eguan@redhat.com \
    --cc=fstests@vger.kernel.org \
    --cc=linux-unionfs@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