public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Amir Goldstein <amir73il@gmail.com>
Cc: Eryu Guan <eguan@redhat.com>,
	linux-xfs@vger.kernel.org, fstests@vger.kernel.org
Subject: Re: [PATCH] xfs_io: support -c <cmd> without <file> args
Date: Mon, 5 Dec 2016 22:02:57 +1100	[thread overview]
Message-ID: <20161205110257.GC4326@dastard> (raw)
In-Reply-To: <1480921485-14888-1-git-send-email-amir73il@gmail.com>

On Mon, Dec 05, 2016 at 09:04:45AM +0200, Amir Goldstein wrote:
> There is an undocumented and possibly unused feature in xfs_io
> where all commands are executed per file given in the file args list.
> 
> This feature creates ambiguity when trying to execute commands
> such as "open" and "file" from command line.
> 
> When running xfs_io -c <cmd> without any file args, xfs_io exits
> without doing anything. This behavior is undocumented and does not
> make much sense either.
> 
> Change the behavior in the case where no file args are given in
> command line to execute every command exactly once, exactly as if
> the commands where executed from an interactive shell.
> 
> This enables writing proper xfs_io scripts in command line, which
> include "open" and "file" commands.

NACK.

This does not fix any of the underlying problems. It just adds
another WTF case to CLI processing as two things that should be
equivlent now behave differently. i.e.

$ xfs_io -c "open foo" -c "open bar" -c file

and 

$ xfs_io -c "open bar" -c file foo

will have different behaviour, even though the man page says they
should be equivalent and do exactly the same thing.

Fix the underlying problems once and for all: do not hack bandaids
into the code that only hides the symptom for your specific use
case.

-Dave.
-- 
Dave Chinner
david@fromorbit.com

  reply	other threads:[~2016-12-05 11:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-05  7:04 [PATCH] xfs_io: support -c <cmd> without <file> args Amir Goldstein
2016-12-05 11:02 ` Dave Chinner [this message]
2016-12-05 11:27   ` 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=20161205110257.GC4326@dastard \
    --to=david@fromorbit.com \
    --cc=amir73il@gmail.com \
    --cc=eguan@redhat.com \
    --cc=fstests@vger.kernel.org \
    --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