Re: [PATCH] xfs_io: support -c <cmd> without <file> args

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

 



On Mon, Dec 5, 2016 at 1:02 PM, Dave Chinner <david@xxxxxxxxxxxxx> wrote:
> 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
>

You meant:
$ xfs_io -c "open foo" -c "open bar"

> 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,

I would be glad to fix the code, but you did not answer my question.

The "execute all commands per file" behavior is not documented,
does not appear to have any known users and makes every attempt
to parse "file" commands ambiguous.

Can we, in your option, do away with this behavior?

If the answer is yes, then the patch is even simpler then these 16 lines.
Just replace the old init_args_command() with the new
do_once_args_command().

Would you like me to re-submit the patch with this change?

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



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux