diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2009-12-19 16:15:07 +0100 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2009-12-22 18:27:34 +0100 |
commit | 5300990c0370e804e49d9a59d928c5d53fb73487 (patch) | |
tree | 08ed922afd172662039c082ec9e9410070f4afe8 /fs/open.c | |
parent | Fix f_flags/f_mode in case of lookup_instantiate_filp() from open(pathname, 3) (diff) | |
download | linux-5300990c0370e804e49d9a59d928c5d53fb73487.tar.xz linux-5300990c0370e804e49d9a59d928c5d53fb73487.zip |
Sanitize f_flags helpers
* pull ACC_MODE to fs.h; we have several copies all over the place
* nightmarish expression calculating f_mode by f_flags deserves a helper
too (OPEN_FMODE(flags))
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/open.c')
-rw-r--r-- | fs/open.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/open.c b/fs/open.c index 6daee28f6e8f..040cef72bc00 100644 --- a/fs/open.c +++ b/fs/open.c @@ -828,7 +828,7 @@ static struct file *__dentry_open(struct dentry *dentry, struct vfsmount *mnt, struct inode *inode; int error; - f->f_mode = (__force fmode_t)((f->f_flags+1) & O_ACCMODE) | FMODE_LSEEK | + f->f_mode = OPEN_FMODE(f->f_flags) | FMODE_LSEEK | FMODE_PREAD | FMODE_PWRITE; inode = dentry->d_inode; if (f->f_mode & FMODE_WRITE) { |