patch for 2.1.46-1 dangling symlink oops

Bill Hawes (whawes@star.net)
Sat, 19 Jul 1997 11:00:32 -0400


This is a multi-part message in MIME format.
--------------08936D058E6C90C21D71F5B4
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

I got bit by the dangling symlink problem reported recently ... attached
is a patch to fix it.

Regards,
Bill
--------------08936D058E6C90C21D71F5B4
Content-Type: text/plain; charset=us-ascii; name="namei_46-patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="namei_46-patch"

--- fs/namei.c.old Sat Jul 19 08:45:16 1997
+++ fs/namei.c Sat Jul 19 10:38:07 1997
@@ -388,12 +388,10 @@
struct qstr this;
char c, follow;

- dentry = base;
- if (IS_ERR(base))
- break;
- dentry = ERR_PTR(-ENOENT);
- if (!base->d_inode)
+ if (!base->d_inode) {
+ dentry = ERR_PTR(-ENOENT);
break;
+ }
this.name = name;
hash = init_name_hash();
len = 0;
@@ -424,7 +422,7 @@
break;

base = do_follow_link(base, dentry);
- if (c)
+ if (!IS_ERR(base) && c)
continue;

return base;

--------------08936D058E6C90C21D71F5B4--