Whamcloud - gitweb
LU-12650 lib: fix strings comparison during mount searching 11/36211/2
authorArtem Blagodarenko <c17828@cray.com>
Fri, 9 Aug 2019 19:19:29 +0000 (22:19 +0300)
committerOleg Drokin <green@whamcloud.com>
Mon, 23 Sep 2019 08:40:19 +0000 (08:40 +0000)
commit9ab5dc7b1f3d3814b6d876e427c56415e8c7bb8a
tree2fdbcca732843c87174b778b3562b59d791c454d
parent4745898c73a9d72142cbb2a7eeb9a16598a06fef
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.

Lustre-change: https://review.whamcloud.com/35755
Lustre-commit: 0817efd73f04bf59d1234887bc3971d2d067067e

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