fs/namei.c lookup_flags is misleading
2.4.6-pre3 and earlier. fs/namei.c:lookup_flags() checks for O_CREATE, it even has a comment saying that O_CREATE|O_EXCL is a special case. But the only place lookup_flags() is called has
if (!(flag & O_CREAT)) {
if (path_init(pathname, lookup_flags(flag), nd))
so O_CREATE can never be set. Not a bug, just misleading. It does not help that path_walk() has a variable called lookup_flags.