Ok, this seems to be due to pre9 removing some rather bogus code that
happened to hide another problem in open_namei().
I haven't actually tested this, but it looks really obvious, so does this
patch fix it for you? (This should also fix a potential performance
bogosity - there's absolutely no reason why we should get the directory
lock when we don't need to for a normal open of an existing file).
Linus
-----
--- v2.2.0-pre9/linux/fs/namei.c Wed Jan 20 23:14:06 1999
+++ linux/fs/namei.c Sun Jan 24 21:48:39 1999
@@ -678,9 +678,12 @@
if (flag & O_CREAT) {
struct dentry *dir;
- error = -EEXIST;
- if (dentry->d_inode && (flag & O_EXCL))
+ if (dentry->d_inode) {
+ if (!(flag & O_EXCL))
+ goto nocreate;
+ error = -EEXIST;
goto exit;
+ }
dir = lock_parent(dentry);
if (!check_parent(dir, dentry)) {
@@ -723,6 +726,7 @@
goto exit;
}
+nocreate:
error = -ENOENT;
inode = dentry->d_inode;
if (!inode)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/