Whamcloud - gitweb
LU-10391 ptlrpc: update import debugfs to support IPv6 formats 17/53117/7
authorJames Simmons <jsimmons@infradead.org>
Wed, 22 Nov 2023 00:26:52 +0000 (19:26 -0500)
committerOleg Drokin <green@whamcloud.com>
Wed, 13 Dec 2023 12:17:55 +0000 (12:17 +0000)
commit03f4ef7f32692cfdbe9fc20c218fea75ec3aee08
treec1358c4d7b4ca42c147487f26e12efcbb166eed6
parentee7dfc5ad17d322e2e27ea2629c4a2d8e11a3507
LU-10391 ptlrpc: update import debugfs to support IPv6 formats

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>
lustre/obdclass/lprocfs_status.c
lustre/ptlrpc/lproc_ptlrpc.c