} else {
/* Not enough room to add suffix */
llapi_err_noerrno(LLAPI_MSG_ERROR,
- "MDT name too long |%s|", name);
+ "Invalid MDT name |%s|", name);
return -EINVAL;
}
}
const char *fidstr_orig = fidstr;
struct lu_fid fid;
struct getinfo_fid2path *gf;
+ char *a;
+ char *b;
int rc;
while (*fidstr == '[')
if (rc)
goto out_free;
- memcpy(buf, gf->gf_u.gf_path, gf->gf_pathlen);
+ b = buf;
+ /* strip out instances of // */
+ for (a = gf->gf_u.gf_path; *a != '\0'; a++) {
+ if ((*a == '/') && (*(a + 1) == '/'))
+ continue;
+ *b = *a;
+ b++;
+ }
+ *b = '\0';
+
if (buf[0] == '\0') { /* ROOT path */
buf[0] = '/';
buf[1] = '\0';
}
+
*recno = gf->gf_recno;
*linkno = gf->gf_linkno;