[PATCH] nvme-cli: attach ns to local controller if none specified

Chaitanya Kulkarni chaitanyak at nvidia.com
Mon Mar 31 14:16:49 PDT 2025


On 3/31/25 13:57, Keith Busch wrote:
> On Mon, Mar 31, 2025 at 08:37:31PM +0000, Chaitanya Kulkarni wrote:
>> On 3/31/25 12:08, Keith Busch wrote:
>>> From: Keith Busch<kbusch at kernel.org>
>>>
>>> Assume the user meant to attach the namespace to the controller the
>>> command was sent to if the user didn't provide a controller id list.
>>>
>>> Suggested-by: Nilay Shroff<nilay at linux.ibm.com>
>>> Signed-off-by: Keith Busch<kbusch at kernel.org>
>> this will not be backward compatible hence all the existing deployments
>> that are resulting in error [1] will now attach the default controller,
>> I believe that is what is expected ?
> Yes, this changes behavior. I don't think a user would purposefully
> request to attach a namespace to nothing. If they explicitly request
> that via '-c ""', then that request will still be honored. But if they
> omit the list entirely, I think it's reasonable to assume you want the
> controller servicing the command to attach the namespace to itself.
>
> It's really a nice workflow optimization since you can skip finding the
> controller id when you just want local attachment.
>   

Yes, someone who's using nvme-cli from very start I totally agree :).

>> if not then do we need add a version check so it will stay as backward
>> compatible ?
> I don't follow what you mean here. What version of what component could
> be checked to guide this behavior?

if we can only enable this functionality for nvme-cli/libnvme for the 
current
version and any other versions after current version.

In case nvme-cli or libnvme has a version below the current version, then
it can follow the original behavior, will this work or not ?

-ck




More information about the Linux-nvme mailing list