[lustre-discuss] lfs find %LF
Andreas Dilger
adilger at whamcloud.com
Thu Aug 22 05:37:33 PDT 2024
On Aug 21, 2024, at 09:42, Michael DiDomenico via lustre-discuss <lustre-discuss at lists.lustre.org<mailto:lustre-discuss at lists.lustre.org>> wrote:
as far as i can tell most of the time when lustre outputs a fid it's bracketed
[0x20000e279:0x1340:0x0]
however, if you run
lfs find <filename> -printf "%LF\n"
0x20000e279:0x1340:0x0
the fid comes out unbracketed. i don't think most of the tools care
as they're likely striping off the brackets, just curious if there's a
reason for the different output or is it an oversight?
Using "[]" around the FID can cause problems with shell expansion, which thinks it is a list of possible characters.
So, for example if "lfs fid2path /mnt/testfs [0x20000e279:0x1340:0x0]" is used (and "[]" are not escaped), the shell will match any file with a name "[0123479ex:]", which can cause strange problems (sometimes users have files named "0" or "2" due to bad stderr redirection).
All of the in-tree tools can handle FIDs without the [], but we can't remove them for compatibility if external tools expect to see them. It also makes the FIDs more visually identifiable in the logs.
Cheers, Andreas
--
Andreas Dilger
Lustre Principal Architect
Whamcloud
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lustre.org/pipermail/lustre-discuss-lustre.org/attachments/20240822/eabedfed/attachment.htm>
More information about the lustre-discuss
mailing list