Whamcloud - gitweb
b=16855
authorkalpak <kalpak>
Wed, 10 Dec 2008 02:13:13 +0000 (02:13 +0000)
committerkalpak <kalpak>
Wed, 10 Dec 2008 02:13:13 +0000 (02:13 +0000)
i=nathan

Fix small bug in search_fsname()

lustre/utils/liblustreapi.c

index 83d6990..3927ca6 100644 (file)
@@ -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;