Re: wrong hardlink count for /proc/PID directories

From: H. Peter Anvin
Date: Wed Dec 29 2004 - 20:14:31 EST


Followup to: <Pine.LNX.4.61.0412222340540.475@xxxxxxxxxxxxxxx>
By author: Jan Engelhardt <jengelh@xxxxxxxxxxxxxxx>
In newsgroup: linux.dev.kernel
>
> You could try working around this by using -noleaf. (Which is by no means a
> solution.)
>
> Hm, I have 2.6.8+.9-rc2, and /proc/1 for example has a link count of 3 which
> seems reasonable: ".", "fd" and "task".
>

You're missing "attr", and you're not counting the directory entry
from below.

directory + "." + "attr/.." + "fd/.." + "task/.." = 5.

It should either return the correct value or set it to 1.

-hpa
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/