patch-2.2.0-pre9 linux/fs/namei.c

Next file: linux/fs/proc/array.c
Previous file: linux/fs/Config.in
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.0-pre8/linux/fs/namei.c linux/fs/namei.c
@@ -882,8 +882,16 @@
 	if (IS_ERR(dentry))
 		goto exit;
 
+	/*
+	 * EEXIST is kind of a strange error code to
+	 * return, but basically if the dentry was moved
+	 * or unlinked while we locked the parent, we
+	 * do know that it _did_ exist before, and as
+	 * such it makes perfect sense.. In contrast,
+	 * ENOENT doesn't make sense for mkdir.
+	 */
 	dir = lock_parent(dentry);
-	error = -ENOENT;
+	error = -EEXIST;
 	if (!check_parent(dir, dentry))
 		goto exit_lock;
 

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