static inline int do_follow_link(struct dentry *dentry, struct nameidata *nd) {

current->link_count++; current->total_link_count++;


When is the value of total_link_count reset? Not at all — at least not during lookup for a single path component. Because this counter is a mechanism to limit the total number of links used (which need not be recursive to reach a high figure), the counter is reset to 0 when lookup is initiated for a full path or filename in path_walk (this function is called by do_path_lookup). Every symbolic link in the lookup operation (not just recursive links) adds to its value.

Continue reading here: Opening Files

Was this article helpful?

0 0