[LU-5746] llapi: fid2path doesn't return all the names associated with a fid Created: 15/Oct/14 Updated: 17/Oct/14 Resolved: 17/Oct/14 |
|
| Status: | Resolved |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Frank Zago (Inactive) | Assignee: | Andreas Dilger |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Severity: | 3 |
| Rank (Obsolete): | 16139 |
| Description |
|
llapi_fid2path can (or should) enumerate all the files associated with a fid, by using the linkno parameter. This is supported by lfs. However when the number of hard link is big, this is no longer true. For instance, create a file, and many hardlinks to it: cd /mnt/lustre/test/ touch foo count=1; while [[ $count -le 180 ]]; do ln foo alinktofoo$count; (( count++ )) ; done Get the fid of the file # ~/lustre-cleanup/lustre/utils/lfs path2fid ./foo [0x200000400:0x8b8:0x0] and then call fid2path on it: # ~/lustre-cleanup/lustre/utils/lfs fid2path /mnt/lustre/ 0x200000400:0x8b8:0x0 The output will be something like /mnt/lustre/test/foo /mnt/lustre/test/alinktofoo1 /mnt/lustre/test/alinktofoo2 /mnt/lustre/test/alinktofoo3 /mnt/lustre/test/alinktofoo4 ....... /mnt/lustre/test/alinktofoo130 /mnt/lustre/test/alinktofoo131 /mnt/lustre/test/alinktofoo132 Only the first 133 entries are returned, leaving out 47. The interesting thing is that if the names of the links are longer (replace alinktofoo$count with averylinktofoo$count), then even less names will be returned. Potential impact on existing programs is unknown. |
| Comments |
| Comment by Patrick Farrell (Inactive) [ 15/Oct/14 ] |
|
I'm mostly just free associating, but is there any link to the limit/optimization described by Andreas at the end of the comments here: |
| Comment by Frank Zago (Inactive) [ 15/Oct/14 ] |
|
In a similar testing, if the length of the link names are 8 characters, 158 entries are returned. As the length grows, less entries are returned. With 63 characters, it's 55 entries. With 83, it's 43 entries. At the maximum length (255), only 13 entries are returned. The length of the leading path doesn't appear to have any influence. |
| Comment by Andreas Dilger [ 17/Oct/14 ] |
|
As described in
If the large_xattr feature is enabled on the MDS, it is able to store more links, but this comes with a noticeable performance cost as the link count increases. In our surveys of HPC filesystems[*] there are rarely more than a handful of links on regular files, and having more than a hundred links to a file is basically nonexistent. Is this a real problem on a real system, or just something that you found while testing corner conditions? [*] http://www.pdsi-scidac.org/fsstats/ has some results, and we've asked users to run this tool on their filesystems and send us the output along with "lfs df" and "lfs df -i". |
| Comment by Frank Zago (Inactive) [ 17/Oct/14 ] |
|
This is something I found while writing some test code for the fid API. |