I noticed another (potential) issue with symlinks and the project ID. For most attributes it appears lfs find uses data from the symlink itself, but for project ID, lfs find seems to use the value from the target:
$ touch file20 && lfs project -p 20 file20
$ ln -s file20 link21 && lfs project -p 21 link21
$ lfs project .
20 - ./file20
21 - ./link21
# including %s in the format string to demonstrate that lfs find uses values from the link itself (and not the target) for attributes other than project id
$ lfs find . --printf "%p %s %LP\n"
. 4096 0
./file20 0 20
./link21 6 20
Would we expect that lfs find would use the value from the link in this case?
Interestingly, I ran a quick test on ext4 and found that (at least in my setup) projid on symlinks did not work:
ext4-mount $ touch file20 && chattr -p 20 file20
ext4-mount $ ln -s file20 link21
ext4-mount $ chattr -p 21 link21
chattr: Operation not supported while reading flags on link21
ext4-mount $ lsattr -p .
0 --------------e------- ./lost+found
lsattr: Operation not supported While reading flags on ./link21
20 --------------e------- ./file20
I am not sure what the "expected" behavior of projid and symlinks is so I don't know if the lfs find behavior above is problematic.
@adilger any thoughts on this? If the current behavior is wrong should I submit a ticket for this?
Landed for 2.16