Skip to content

Commit

Permalink
[PATCH] open: cleanup in lookup_flags()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Al Viro <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
szmi authored and Linus Torvalds committed Oct 31, 2005
1 parent a928972 commit 42e50a5
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -1311,9 +1311,6 @@ static inline int may_create(struct inode *dir, struct dentry *child,
}

/*
* 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)
Expand All @@ -1323,9 +1320,6 @@ static inline int lookup_flags(unsigned int f)
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;

Expand Down

0 comments on commit 42e50a5

Please sign in to comment.