Re: [PATCH v3 RESEND 2/2] usbip: apply list options regardless of order

Greg KH <[email protected]>
Newsgroups org.kernel.vger.linux-usb,org.kernel.vger.linux-kernel
Message-ID <2026081209-boring-discolor-5b45@gregkh>
On Wed, Aug 12, 2026 at 02:39:10AM -0400, Jason Colapietro wrote:
> usbip_list() acts on -r, -l and -d as soon as getopt_long() returns them,
> so any option parsed afterwards is never seen. -p therefore only takes
> effect when it precedes the mode selector: "usbip list -p -r <host>" is
> parsable while "usbip list -r <host> -p" is not, and -l and -d behave the
> same way. Nothing in the usage text suggests the order matters.
> 
> Record the requested mode during the option loop and run it once parsing
> has finished, so -p applies wherever it appears on the command line. When
> several mode selectors are given the first one still wins, as before.

This changes how the program works, so this might break existing
systems.

Is this a real problem as-is?  If not, I'd be very careful in changing
anything here...

thanks,

greg k-h
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.