patch-2.1.46 linux/fs/namei.c

Next file: linux/fs/open.c
Previous file: linux/fs/minix/namei.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.45/linux/fs/namei.c linux/fs/namei.c
@@ -255,7 +255,6 @@
 		}
 		up(&dir->i_sem);
 	}
-	up(&dir->i_sem);
 	return result;
 }
 
@@ -380,7 +379,7 @@
 	}
 
 	if (!*name)
-		return base;
+		goto return_base;
 
 	/* At this point we know we have a real path component. */
 	for(;;) {
@@ -422,9 +421,10 @@
 			break;
 
 		base = do_follow_link(base, dentry);
-		if (c)
+		if (c && !IS_ERR(base))
 			continue;
 
+return_base:
 		return base;
 	}
 	dput(base);
@@ -742,7 +742,7 @@
 	struct inode *dir;
 	struct dentry *dentry;
 
-	dentry = lookup_dentry(name, NULL, 1);
+	dentry = lookup_dentry(name, NULL, 0);
 	error = PTR_ERR(dentry);
 	if (IS_ERR(dentry))
 		goto exit;
@@ -1051,13 +1051,13 @@
 	struct inode * old_dir, * new_dir;
 	struct dentry * old_dentry, *new_dentry;
 
-	old_dentry = lookup_dentry(oldname, NULL, 1);
+	old_dentry = lookup_dentry(oldname, NULL, 0);
 
 	error = PTR_ERR(old_dentry);
 	if (IS_ERR(old_dentry))
 		goto exit;
 
-	new_dentry = lookup_dentry(newname, NULL, 1);
+	new_dentry = lookup_dentry(newname, NULL, 0);
 
 	error = PTR_ERR(new_dentry);
 	if (IS_ERR(new_dentry))

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov