]> www.infradead.org Git - users/hch/nvme-cli.git/commit
fabrics: Fix disconnect_by_device from disconnecting instance 0 on error
authorLogan Gunthorpe <logang@deltatee.com>
Tue, 28 Mar 2017 19:26:41 +0000 (13:26 -0600)
committerLogan Gunthorpe <logang@deltatee.com>
Tue, 28 Mar 2017 19:32:02 +0000 (13:32 -0600)
commit41e3e96c12a138eddfe41f1db4deb57044bd4307
tree131dac984e654f3ca75afd832264e38bcf467c8f
parent5e71f93bff8738ac81264643a4f97648e5239afe
fabrics: Fix disconnect_by_device from disconnecting instance 0 on error

I was a bit surprised that running:

nvme disconnect -d /dev/nvme1

actually disconnected nvme0 and I could never disconnect nvme1. Turns
out the code was not expecting a full path and silently used instance
zero if it failed to parse any arguments.

This patch fixes it so that it ignores any path component and fails if
sscanf doesn't match any items.
fabrics.c