When mounting with IPv6 NIDs setting the connection will fail with
LustreError: (lproc_ptlrpc.c:1417:ldebugfs_import_seq_write()) config: wrong instance # d967@tcp::1
This is due to IPv6 NIDs being able to contain "::" which is used
as a delimiter. Update the code to search for '@' which is unique
for the NID and then look for "::". For reading the import we need
to quote all the NID strings to make it valid YAML.
This changes the import output from:
import:
name: lustre-MDT0000-mdc-
ffff96c7070a2800
target: lustre-MDT0000_UUID
state: FULL
....
connection:
failover_nids: [ 10.37.248.15@tcp, 192.168.1.100@tcp ]
current_connection: 10.37.248.15@tcp
connection_attempts: 1
generation: 1
in-progress_invalidations: 0
idle: 64 sec
....
to the following:
import:
name: lustre-MDT0000-mdc-
ffff96c7070a2800
target: lustre-MDT0000_UUID
state: FULL
....
connection:
failover_nids: [ "10.37.248.15@tcp", "192.168.1.100@tcp" ]
current_connection: "10.37.248.15@tcp"
connection_attempts: 1
generation: 1
in-progress_invalidations: 0
idle: 64 sec
....
Change-Id: Ie68d544d8733b87d04fa0c2385de2319696b3289
Signed-off-by: James Simmons <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/53117
Reviewed-by: Neil Brown <neilb@suse.de>
Reviewed-by: Feng Lei <flei@whamcloud.com>
Reviewed-by: Timothy Day <timday@amazon.com>
Reviewed-by: Nathaniel Clark <nclark@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
list_for_each_entry(conn, &imp->imp_conn_list, oic_item) {
libcfs_nidstr_r(&conn->oic_conn->c_peer.nid,
nidstr, sizeof(nidstr));
- seq_printf(m, "%s%s", j ? ", " : "", nidstr);
+ if (j)
+ seq_puts(m, ", ");
+ /* Place nidstr in quotes */
+ seq_printf(m, "\"%s\"", nidstr);
j++;
}
if (imp->imp_connection)
else
strncpy(nidstr, "<none>", sizeof(nidstr));
seq_printf(m, " ]\n"
- " current_connection: %s\n"
+ " current_connection: \"%s\"\n"
" connection_attempts: %u\n"
" generation: %u\n"
" in-progress_invalidations: %u\n"
struct obd_device *obd = m->private;
struct obd_import *imp;
char *kbuf = NULL;
- char *uuid;
- char *ptr;
int do_reconn = 1;
const char prefix[] = "connection=";
const int prefix_len = sizeof(prefix) - 1;
GOTO(out, rc = -EINVAL);
with_imp_locked(obd, imp, rc) {
- uuid = kbuf + prefix_len;
- ptr = strstr(uuid, "::");
+ char *uuid = kbuf + prefix_len;
+ char *ptr, *tmp;
+
+ tmp = strchr(uuid, '@');
+ if (!tmp)
+ GOTO(out, rc = -EINVAL);
+
+ ptr = strstr(tmp, "::");
if (ptr) {
u32 inst;
int rc;