On Aug 21, 2024, at 09:42, Michael DiDomenico via lustre-discuss 
<[email protected]<mailto:[email protected]>> 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







_______________________________________________
lustre-discuss mailing list
[email protected]
http://lists.lustre.org/listinfo.cgi/lustre-discuss-lustre.org

Reply via email to