From: Sebastien Buisson Date: Mon, 25 Mar 2013 13:52:34 +0000 (+0100) Subject: LU-3023 build: fix fuzzy logic in get_root_path() X-Git-Tag: 2.3.65~17 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=11a207f3f6cc6c8b9d6da15dce47ef410b5dd240;p=fs%2Flustre-release.git LU-3023 build: fix fuzzy logic in get_root_path() Thanks to the call to llapi_is_lustre_mnt(), we are sure that mnt.mnt_fsname contains ":/". And, if no other mountpoint is found (len ==0), there is no reason to abort scanning, so the check and -EINVAL can just be removed. Signed-off-by: Sebastien Buisson Change-Id: Id77c41fbf53782d657034f152f724a3bdc83408c Reviewed-on: http://review.whamcloud.com/5832 Reviewed-by: John Hammond Tested-by: Hudson Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: James Nunez --- diff --git a/lustre/utils/liblustreapi.c b/lustre/utils/liblustreapi.c index 6d0d385..5e76bca 100644 --- a/lustre/utils/liblustreapi.c +++ b/lustre/utils/liblustreapi.c @@ -878,10 +878,11 @@ int get_root_path(int want, char *fsname, int *outfd, char *path, int index) mntlen = strlen(mnt.mnt_dir); ptr = strrchr(mnt.mnt_fsname, '/'); - if (!ptr && !len) { - rc = -EINVAL; - break; - } + /* thanks to the call to llapi_is_lustre_mnt() above, + * we are sure that mnt.mnt_fsname contains ":/", + * so ptr should never be NULL */ + if (ptr == NULL) + continue; ptr++; /* Check the fsname for a match, if given */