diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-06-25 19:15:54 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2011-07-20 01:43:52 -0400 |
commit | 8a5e929dd2e05ab4d3d89f58c5e8fca596af8f3a (patch) | |
tree | 8cbed05fcd99d24e881e5ea12d8a954865e31085 /fs/namei.c | |
parent | 554a8b9f54cd7ca2b89f5dc227df08be082fae0d (diff) |
don't transliterate lower bits of ->intent.open.flags to FMODE_...
->create() instances are much happier that way...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namei.c')
-rw-r--r-- | fs/namei.c | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/fs/namei.c b/fs/namei.c index 94fd0fa2d647..5e65f67ee926 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -1965,27 +1965,10 @@ static int handle_truncate(struct file *filp) | |||
1965 | return error; | 1965 | return error; |
1966 | } | 1966 | } |
1967 | 1967 | ||
1968 | /* | ||
1969 | * Note that while the flag value (low two bits) for sys_open means: | ||
1970 | * 00 - read-only | ||
1971 | * 01 - write-only | ||
1972 | * 10 - read-write | ||
1973 | * 11 - special | ||
1974 | * it is changed into | ||
1975 | * 00 - no permissions needed | ||
1976 | * 01 - read-permission | ||
1977 | * 10 - write-permission | ||
1978 | * 11 - read-write | ||
1979 | * for the internal routines (ie open_namei()/follow_link() etc) | ||
1980 | * This is more logical, and also allows the 00 "no perm needed" | ||
1981 | * to be used for symlinks (where the permissions are checked | ||
1982 | * later). | ||
1983 | * | ||
1984 | */ | ||
1985 | static inline int open_to_namei_flags(int flag) | 1968 | static inline int open_to_namei_flags(int flag) |
1986 | { | 1969 | { |
1987 | if ((flag+1) & O_ACCMODE) | 1970 | if ((flag & O_ACCMODE) == 3) |
1988 | flag++; | 1971 | flag--; |
1989 | return flag; | 1972 | return flag; |
1990 | } | 1973 | } |
1991 | 1974 | ||