rm $DIR/$tdir/$tfile
# rename
mv $DIR/$tdir/foo1/sofia $DIR/$tdir/foo2/maggie
- if [ "$($LFS fid2path $DIR --link 1 $FID)" != "/$tdir/foo2/maggie" ]
+ if [ "$($LFS fid2path $FSNAME --link 1 $FID)" != "$tdir/foo2/maggie" ]
then
$LFS fid2path $DIR $FID
err17935 "bad link rename"
mkdir -p $DIR/$tdir/d2/p/q/r
# regular file
FID=$($LFS path2fid $DIR/$tdir/d2/$tfile | tr -d '[')
- check_path "/$tdir/d2/$tfile" $DIR $FID --link 0
+ check_path "$tdir/d2/$tfile" $FSNAME $FID --link 0
# softlink
ln -s $DIR/$tdir/d2/$tfile $DIR/$tdir/d2/p/q/r/slink
FID=$($LFS path2fid $DIR/$tdir/d2/p/q/r/slink | tr -d '[')
- check_path "/$tdir/d2/p/q/r/slink" $DIR $FID --link 0
+ check_path "$tdir/d2/p/q/r/slink" $FSNAME $FID --link 0
# hardlink
ln $DIR/$tdir/d2/$tfile $DIR/$tdir/d2/p/q/r/hlink
mv $DIR/$tdir/d2/$tfile $DIR/$tdir/d2/a/b/c/new_file
FID=$($LFS path2fid $DIR/$tdir/d2/a/b/c/new_file | tr -d '[')
# fid2path dir/fsname should both work
- check_path "/$tdir/d2/a/b/c/new_file" $FSNAME $FID --link 1
- check_path "/$tdir/d2/p/q/r/hlink" $DIR $FID --link 0
+ check_path "$tdir/d2/a/b/c/new_file" $FSNAME $FID --link 1
+ check_path "$DIR/$tdir/d2/p/q/r/hlink" $DIR $FID --link 0
# hardlink count: check that there are 2 links
# Doesnt work with CMD yet: 17935
# hardlink indexing: remove the first link
rm $DIR/$tdir/d2/p/q/r/hlink
- check_path "/$tdir/d2/a/b/c/new_file" $DIR $FID --link 0
+ check_path "$tdir/d2/a/b/c/new_file" $FSNAME $FID --link 0
return 0
}
" -i can be used instead of --inode-softlimit/--inode-grace\n"
" -I can be used instead of --inode-hardlimit"},
{"quota", lfs_quota, 0, "Display disk usage and limits.\n"
- "usage: quota [-v] [-o obd_uuid|-i mdt_idx|-I ost_idx]\n"
+ "usage: quota [-v] [-o obd_uuid|-i mdt_idx|-I ost_idx]\n"
" [<-u|-g> <uname>|<uid>|<gname>|<gid>] <filesystem>\n"
" quota [-o obd_uuid|-i mdt_idx|-I ost_idx] -t <-u|-g> <filesystem>"},
{"quotainv", lfs_quotainv, 0, "Invalidate quota data.\n"
"be found.\n", optarg);
return -1;
}
- }
+ }
param.exclude_gid = !!neg_opt;
param.check_gid = 1;
break;
qctl.qc_id = strtoul(optarg, &endptr, 10);
if (*endptr != '\0') {
fprintf(stderr, "error: can't find id "
- "for name %s\n", optarg);
+ "for name %s\n", optarg);
return CMD_HELP;
}
}
}
if (printcur)
- fprintf(stdout, "%lld %s\n", rectmp, path);
- else
- fprintf(stdout, "%s\n", path);
+ fprintf(stdout, "%lld ", rectmp);
+ if (device[0] == '/') {
+ fprintf(stdout, "%s", device);
+ if (device[strlen(device) - 1] != '/')
+ fprintf(stdout, "/");
+ } else if (path[0] == '\0') {
+ fprintf(stdout, "/");
+ }
+ fprintf(stdout, "%s\n", path);
if (linkno >= 0)
/* specified linkno */
/* Is f2p(pfid) present on the target? If not, the parent has
moved */
if (!mkspecial) {
- snprintf(info->dest, PATH_MAX, "%s%s", status->ls_targets[0],
+ snprintf(info->dest, PATH_MAX, "%s/%s", status->ls_targets[0],
info->path);
if (access(info->dest, F_OK) != 0)
mkspecial = 1;
}
for (info->target_no = 0; info->target_no < status->ls_num_targets;
info->target_no++) {
- snprintf(info->dest, PATH_MAX, "%s%s",
+ snprintf(info->dest, PATH_MAX, "%s/%s",
status->ls_targets[info->target_no], info->savedpath);
lr_get_FID_PATH(status->ls_source, info->tfid, info->src,
PATH_MAX);
rc = rc1;
continue;
}
- snprintf(info->dest, PATH_MAX, "%s%s/%s",
+ snprintf(info->dest, PATH_MAX, "%s/%s/%s",
status->ls_targets[info->target_no], info->path,
info->name);
info->target_no++) {
if (!rc_dest) {
- snprintf(info->dest, PATH_MAX, "%s%s",
+ snprintf(info->dest, PATH_MAX, "%s/%s",
status->ls_targets[info->target_no],
ext->path);
if (access(info->dest, F_OK) != 0) {
rc_dest = -errno;
} else {
- snprintf(info->dest, PATH_MAX, "%s%s/%s",
+ snprintf(info->dest, PATH_MAX, "%s/%s/%s",
status->ls_targets[info->target_no],
ext->path, ext->name);
}
}
if (!rc_src)
- snprintf(info->src, PATH_MAX, "%s%s/%s",
+ snprintf(info->src, PATH_MAX, "%s/%s/%s",
status->ls_targets[info->target_no],
info->path, info->name);
if (rc_src == -ENOENT || (access(info->src, F_OK) != 0 &&
len = strlen(info->path) - strlen(info->name);
if (len > 0 && strcmp(info->path + len,
info->name) == 0)
- snprintf(info->dest, PATH_MAX, "%s%s",
+ snprintf(info->dest, PATH_MAX, "%s/%s",
status->ls_targets[info->target_no],
info->path);
else if (info->src[0] == 0)
- snprintf(info->src, PATH_MAX, "%s%s",
+ snprintf(info->src, PATH_MAX, "%s/%s",
status->ls_targets[info->target_no],
info->path);
}
for (info->target_no = 0; info->target_no < status->ls_num_targets;
info->target_no++) {
- snprintf(info->dest, PATH_MAX, "%s%s",
+ snprintf(info->dest, PATH_MAX, "%s/%s",
status->ls_targets[info->target_no], info->path);
lr_debug(DINFO, "setattr: %s %s %s", info->src, info->dest,
info->tfid);
for (info->target_no = 0; info->target_no < status->ls_num_targets;
info->target_no++) {
- snprintf(info->dest, PATH_MAX, "%s%s",
+ snprintf(info->dest, PATH_MAX, "%s/%s",
status->ls_targets[info->target_no], info->path);
lr_debug(DINFO, "setxattr: %s %s %s\n", info->src, info->dest,
info->tfid);