Whamcloud - gitweb
b=18452
[fs/lustre-release.git] / lustre / utils / liblustreapi.c
index 83d6990..9ef5f2c 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;
@@ -1160,6 +1161,10 @@ static int llapi_semantic_traverse(char *path, int size, DIR *parent,
                 if (!strcmp(dent->d_name, ".") || !strcmp(dent->d_name, ".."))
                         continue;
 
+                /* Don't traverse .lustre directory */
+                if (!(strcmp(dent->d_name, mdd_dot_lustre_name)))
+                        continue;
+
                 path[len] = 0;
                 if ((len + dent->d_reclen + 2) > size) {
                         llapi_err(LLAPI_MSG_ERROR,
@@ -1524,8 +1529,8 @@ static int cb_find_init(char *path, DIR *parent, DIR *dir,
         }
 
 obd_matches:
-        /* If file still fits the request, ask osd for updated info.
-           The regulat stat is almost of the same speed as some new
+        /* If file still fits the request, ask ost for updated info.
+           The regular stat is almost of the same speed as some new
            'glimpse-size-ioctl'. */
         if (!decision && S_ISREG(st->st_mode) &&
             (param->lmd->lmd_lmm.lmm_stripe_count || param->size)) {