From: Miklos Szeredi lookup_flags() is only called from the non-create case, so it needn't check for O_CREAT|O_EXCL. Signed-off-by: Miklos Szeredi Cc: Al Viro Cc: Christoph Hellwig Signed-off-by: Andrew Morton --- fs/namei.c | 6 ------ 1 files changed, 6 deletions(-) diff -puN fs/namei.c~open-cleanup-in-lookup_flags fs/namei.c --- 25/fs/namei.c~open-cleanup-in-lookup_flags Fri Sep 23 14:34:44 2005 +++ 25-akpm/fs/namei.c Fri Sep 23 14:34:44 2005 @@ -1234,9 +1234,6 @@ static inline int may_create(struct inod } /* - * Special case: O_CREAT|O_EXCL implies O_NOFOLLOW for security - * reasons. - * * O_DIRECTORY translates into forcing a directory lookup. */ static inline int lookup_flags(unsigned int f) @@ -1246,9 +1243,6 @@ static inline int lookup_flags(unsigned if (f & O_NOFOLLOW) retval &= ~LOOKUP_FOLLOW; - if ((f & (O_CREAT|O_EXCL)) == (O_CREAT|O_EXCL)) - retval &= ~LOOKUP_FOLLOW; - if (f & O_DIRECTORY) retval |= LOOKUP_DIRECTORY; _