Whamcloud - gitweb
LU-12650 lib: fix strings comparison during mount searching 55/35755/2
authorArtem Blagodarenko <c17828@cray.com>
Fri, 9 Aug 2019 19:19:29 +0000 (22:19 +0300)
committerOleg Drokin <green@whamcloud.com>
Mon, 16 Sep 2019 23:04:37 +0000 (23:04 +0000)
commit0817efd73f04bf59d1234887bc3971d2d067067e
tree23f3fc5adf98cf6c22feed2233e4a1bfb503f411
parentab1a8a0277965395d42db71b6b0f479207c26fdc
LU-12650 lib: fix strings comparison during mount searching

get_root_path() returns path to "lustre" mount instead "lustre1"
because last symbol is not taking in account during comparison.
This bug has influence to get_root_path() users.

For example, fid2path use get_root_path().

lfs path2fid /mnt/lustre2/foodir3
[0x200000401:0x1:0x0]

lfs fid2path lustre2 [0x200000401:0x1:0x0]
lfs fid2path: cannot find '[0x200000401:0x1:0x0]': No such file or
directory

umount /mnt/lustre
lfs fid2path lustre2 [0x200000401:0x1:0x0]
foodir3

This fix adds strings length comparison.

Signed-off-by: Artem Blagodarenko <c17828@cray.com>
Cray-bug-id: LUS-7693
Change-Id: I3275d2182486d25389814f4c25b3f2a54ec29469
Reviewed-on: https://review.whamcloud.com/35755
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Alexander Zarochentsev <c17826@cray.com>
lustre/utils/liblustreapi.c