sshfs
sshfs copied to clipboard
Support st_nlink
SFTP does provide link counts, so we should use these numbers for st_nlink.
It turns out that link count has been defined from https://datatracker.ietf.org/doc/html/draft-ietf-secsh-filexfer-06, but https://datatracker.ietf.org/doc/html/draft-ietf-secsh-filexfer-02 (protocol version 3) is still the most widely implemented one.
Back in 2016, Ryan Hunter sent a patch to @openssh providing an extension named [email protected] (see bug report), but unfortunately it was never accepted (or, apparently, considered).
So the sad state of things is that, much like inode support in #109, we cannot really have proper st_nlink support in sshfs.