public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Amir Goldstein <amir73il@gmail.com>
Cc: Eric Sandeen <sandeen@sandeen.net>, Eryu Guan <eguan@redhat.com>,
	linux-xfs@vger.kernel.org, fstests <fstests@vger.kernel.org>
Subject: Re: [PATCH v2] xfs_io: support -c "open foo" command
Date: Tue, 6 Dec 2016 09:15:48 +1100	[thread overview]
Message-ID: <20161205221548.GD4326@dastard> (raw)
In-Reply-To: <CAOQ4uxhmLe32AMkBmRJx37Pmg3oZMFLt_6Q0kTNYxix_qz7vZA@mail.gmail.com>

On Mon, Dec 05, 2016 at 05:39:17PM +0200, Amir Goldstein wrote:
> On Mon, Dec 5, 2016 at 5:26 PM, Eric Sandeen <sandeen@sandeen.net> wrote:
> > On 12/5/16 9:19 AM, Amir Goldstein wrote:
> >> On Mon, Dec 5, 2016 at 4:19 PM, Eric Sandeen <sandeen@sandeen.net> wrote:
> >>> On 12/5/16 7:03 AM, Amir Goldstein wrote:
> >>>> There is an undocumented and possibly unused feature in xfs_io
> >>>> where all commands are executed per file in the file args list.
> >>>>
> >>>> This feature creates ambiguity when trying to execute commands
> >>>> such as "open" and "file" from command line and result in an
> >>>> endless loop in the command loop code.
> >>>
> >>> I may well be dense, but it's not immediately obvious what the
> >>> old and/or problematic behavior is.  Can you spell it out a bit
> >>> more?  What is an example of this loop?
> >>
> >> $ touch foo
> >> $ xfs_io -c "open foo" foo
> >>
> >> you will see the shit storm
> >
> > ;)  Ok thanks.  (would be nice to have that in the changelog)
> >
> 
> Good point. I will add that.
> 
> 
> >
> > Given that neither the manpage nor the short help mention that more than
> > one filename is accepted, should this even succeed at all?
> >
> 
> Make sense to me to fail on multiple file args.

It doesn't to me.

The fact that xfs_io has an open command, and it has
commands that can act on multiple files (e.g. sendfile) indicate
that it should be able to handle multiple files.

Indeed, in interactive mode, the current file is really just an
index into the stack of open files. It works exactly the same way as
other XFS tools do with context stacks and accessed object rings
(e.g. xfs_db). i.e. you only need to open the file/access the object
once and then you can use the stack/ring to jump straight back to
it. In this case, it's the xfs_io "file" command.

i.e. xfs_io is intended to by able to operate on multiple files at
once, and I do use that in interactive mode from time to time.

What I haven't ever done is try to access that through the command
line, so I didn't know it had this "command loop" iteration problem.

It's the command loop iteration problem we need to fix, not neuter
the multiple file capability of xfs_io.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

  reply	other threads:[~2016-12-05 22:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-05 13:03 [PATCH v2] xfs_io: support -c "open foo" command Amir Goldstein
2016-12-05 14:19 ` Eric Sandeen
2016-12-05 15:19   ` Amir Goldstein
2016-12-05 15:26     ` Eric Sandeen
2016-12-05 15:39       ` Amir Goldstein
2016-12-05 22:15         ` Dave Chinner [this message]
2016-12-06  5:24           ` Amir Goldstein
2016-12-06 23:25             ` Dave Chinner
2016-12-07  4:21               ` 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=20161205221548.GD4326@dastard \
    --to=david@fromorbit.com \
    --cc=amir73il@gmail.com \
    --cc=eguan@redhat.com \
    --cc=fstests@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@sandeen.net \
    /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