There are a few ways to get a path with a // back from
fid2path, make sure we strip them all out
Lustre-commit:
116b73d69bf2462fa9e9b8b9f629794bbda90ee5
Lustre-change: https://review.whamcloud.com/30078
Signed-off-by: Ben Evans <bevans@cray.com>
Signed-off-by: Bob Glossman <bob.glossman@intel.com>
Change-Id: I30591585ccf62e4d793ee658d2772ce1db242034
Reviewed-on: https://review.whamcloud.com/30078
Reviewed-by: Steve Guminski <stephenx.guminski@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-on: https://review.whamcloud.com/31775
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Nunez <james.a.nunez@intel.com>
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;