Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement

Kernel v2.4.12 /fs/namei.c

Filename:/fs/namei.c
Lines Added:8
Lines Deleted:7
Also changed in: (Previous) 2.4.11  2.4.10  2.4.10-pre15  2.4.10-pre14  2.4.10-pre13  2.4.10-pre12 
(Following) 2.4.13-pre4  2.4.13-pre5  2.4.13-pre6  2.4.13  2.4.18-pre7  2.4.18-pre8 

Location
[  2.4.12
  [  fs
     o  namei.c

Patch

diff -u --recursive --new-file v2.4.11/linux/fs/namei.c linux/fs/namei.c
--- v2.4.11/linux/fs/namei.c   Tue Oct  9 17:06:53 2001
+++ linux/fs/namei.c   Wed Oct 10 23:15:49 2001
@@ -325,9 +325,7 @@
 }
 
 /*
- * Yes, this really increments the link_count by 5, and
- * decrements it by 4. Together with checking against 40,
- * this limits recursive symlink follows to 8, while
+ * This limits recursive symlink follows to 8, while
  * limiting consecutive symlinks to 40.
  *
  * Without that kind of total limit, nasty chains of consecutive
@@ -336,16 +334,19 @@
 static inline int do_follow_link(struct dentry *dentry, struct nameidata *nd)
 {
    int err;
-   if (current->link_count >= 40)
+   if (current->link_count >= 5)
+      goto loop;
+   if (current->total_link_count >= 40)
       goto loop;
    if (current->need_resched) {
       current->state = TASK_RUNNING;
       schedule();
    }
-   current->link_count += 5;
+   current->link_count++;
+   current->total_link_count++;
    UPDATE_ATIME(dentry->d_inode);
    err = dentry->d_inode->i_op->follow_link(dentry, nd);
-   current->link_count -= 4;
+   current->link_count--;
    return err;
 loop:
    path_release(nd);
@@ -636,7 +637,7 @@
 
 int path_walk(const char * name, struct nameidata *nd)
 {
-   current->link_count = 0;
+   current->total_link_count = 0;
    return link_path_walk(name, nd);
 }
 


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.