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

Keith Busch kbusch at kernel.org
Mon Mar 31 13:57:11 PDT 2025


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.
 
> 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?



More information about the Linux-nvme mailing list