Re: [PATCH v2] xfs_io: support -c "open foo" command

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



On Mon, Dec 5, 2016 at 4:19 PM, Eric Sandeen <sandeen@xxxxxxxxxxx> 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

>
>> Also, when running xfs_io -c <cmd> without any file args, xfs_io
>> exits without doing anything. This behavior is also undocumented
>> and makes very little sense.
>
> What /should/ it do if there is no file specified?  Is this just for
> cmds that don't require a file, such as "-c sync?"

Execute the commands as if you ran xfs_io and entered those commands
in the shell, for example:

$ xfs_io -c "open foo" -c "pread -v 0 4"

>
>> Change the behavior of xfs_io to execute each command specified
>> with -c <cmd> exactly once, regardless of the number of files in
>> the file args list.
>
> So then which file does it act on?  I'm not saying this is incorrect,
> I'm just not quite understanding what this fixes, and what the new
> behavior is, sorry.
>

You are not to be blamed for not knowing what the old behavior is
it is undocumented and I have never seen it used in tests.

Old behavior of

$ xfs_io -c -c "pread -v 0 4" -c "pread -v 4 8" foo bar

- print 0..4 from foo
- print 4..8 from foo
- print 0..4 from bar
- print 4..8 from bar

New behavior is:

- print 0..4 from bar (the "current" file)
- print 4..8 from bar

Same behavior as when you issue the same command after running

$ xfs_io foo bar

Amir.
--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux