Patch https://review.whamcloud.com/25851 "
LU-6051 utils: allow lfs_migrate to handle hard links" adds the ability to migrate hard-linked files using "lfs fid2path" to determine the names of links to a file, but this command only works as the root user.
So the open of the root directory succeeded, but the ioctl failed. It would be useful if a regular user could run this same command on files that they own.
Also, the "lfs fid2path" command requires specifying the mountpoint of the filesystem (e.g. /mnt/testfs), but if e.g. "$PWD" is given as the mountpoint then it prepends the whole specified path to the start of the returned pathname rather than the actual mountpoint:
It would be useful if specifying "." or any other pathname looked up the mountpoint of that directory based on the current working directory and showed the correct pathnames for the links. It is already looking up the mountpoint in /etc/mtab to open the root directory for the ioctl(), so this shouldn't be too much additional work.