Whamcloud - gitweb
LU-19050 utils: Support long nid lists when getting fs info 21/59421/5
authorMarc Vef <mvef@whamcloud.com>
Sun, 25 May 2025 19:02:50 +0000 (21:02 +0200)
committerOleg Drokin <green@whamcloud.com>
Thu, 12 Jun 2025 06:31:25 +0000 (06:31 +0000)
commitfff7cd33bbb424b770768a71267604b4e87f7276
treec7615f1f97460bf065482de39543ec0cbf907286
parent99b362314b7ac08558ca300d9fe52c5b476a5d0a
LU-19050 utils: Support long nid lists when getting fs info

When "get_root_path_slow()" is called through various user commands,
e.g., "lfs setquota", the internal "root_cache" is filled with mount
point information. The cache's "nid" field allowed 256 characters
which resulted in a buffer overflow for long nidlists that are set
during mount.

This patch removes this limitation and further removes the "nid" field
from the "root_cache" since it is only needed in the "lfs check"
command.  Therefore, the nid list no longer needs to be processed and
put into the cache in the numerous other llapi_* functions where the
nid list is never accessed.

Further, string copy handling was insufficient, allowing the overflow
in the first place, and was updated accordingly for all fields.

Signed-off-by: Marc Vef <mvef@whamcloud.com>
Change-Id: I3d9c30795fba14618368b7b9e1769fe0b07d3fc7
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/59421
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Feng Lei <flei@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/utils/liblustreapi.c
lustre/utils/liblustreapi_root.c
lustre/utils/lustreapi_internal.h
lustre/utils/obd.c