From 134f1e4698acf513506123ec89261b4d36ba5f34 Mon Sep 17 00:00:00 2001 From: kalpak Date: Wed, 10 Dec 2008 02:13:13 +0000 Subject: [PATCH] b=16855 i=nathan Fix small bug in search_fsname() --- lustre/utils/liblustreapi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lustre/utils/liblustreapi.c b/lustre/utils/liblustreapi.c index 83d6990..3927ca6 100644 --- a/lustre/utils/liblustreapi.c +++ b/lustre/utils/liblustreapi.c @@ -417,7 +417,8 @@ static int search_fsname(char *pathname, char *fsname) if (llapi_is_lustre_mnt(mnt)) { /* search by pathname */ if (strncmp(mnt->mnt_dir, pathname, - strlen(mnt->mnt_dir)) == 0) { + max(strlen(pathname), + strlen(mnt->mnt_dir))) == 0) { ptr = strchr(mnt->mnt_fsname, '/'); if (ptr == NULL) return -EINVAL; -- 1.8.3.1