Re: [PATCH] nvme-cli: nvmf-connect@.service: Remove matching from default syntax
From: Martin Wilck <hidden>
Date: 2021-12-17 20:44:10
On Fri, 2021-12-17 at 11:32 -0800, James Smart wrote:
commit 53aab69a0add added the "--matching" argument to the systemd connect script that issues connect-all to a discovery controller. When this argument is used, only discovery log entries whose target port traddr's match the traddr of the discovery controller will be connected to. This eliminates the ability to do referrals by the discovery controller. Revert the commit so that the "--matching" argument is not default behavior.
Hm, I guess you have to do revert this if it breaks referrals. The intention of my patch was not to suppress referrals. Unless I'm mistaken, a referral is a log page entry that lists another discovery controller, on which then another discovery is carried out. The "-- matching" parameter was intended to ignore log page entries listing ordinary (non-discovery) subsystems on if their traddr didn't match the discovery controller's traddr. I still think connecting to those entries is wrong more often than not. In the environment I was testing in back then, IIRC there were 4 discovery controllers, each listing every subsystem on every controller. The host would try to connect to every subsystem 4 times, resulting in error messages 3 out of 4 times. With --matching, these errors could be avoided. I believe the correct solution would be to fix the way referrals are handled with --matching. If a discovery subsystem D1 refers to another discovery subsystem D2, then on D2 those entries that match the traddr of D2 should be considered "matching", and so on with additional referrals. Obviously, "--matching" would need to be ignored for the referral entries themselves. But as long as we haven't fixed this logic, I'm fine with your patch. Martin
quoted hunk ↗ jump to hunk
Signed-off-by: James Smart <redacted> CC: Martin Wilck <redacted> --- nvmf-autoconnect/systemd/nvmf-connect@.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)diff --git a/nvmf-autoconnect/systemd/nvmf-connect@.service b/nvmf-autoconnect/systemd/nvmf-connect@.service index 5fbf081..c60f146 100644--- a/nvmf-autoconnect/systemd/nvmf-connect@.service +++ b/nvmf-autoconnect/systemd/nvmf-connect@.service@@ -11,4 +11,4 @@ Requires=nvmf-connect.target[Service] Type=simple Environment="CONNECT_ARGS=%i" -ExecStart=/bin/sh -c "nvme connect-all --matching --quiet `/bin/echo -e '${CONNECT_ARGS}'`" +ExecStart=/bin/sh -c "nvme connect-all --quiet `/bin/echo -e '${CONNECT_ARGS}'`"