From: Miklos Szeredi Date: Wed, 15 Aug 2012 11:01:24 +0000 (+0200) Subject: vfs: atomic_open(): fix create mode usage X-Git-Tag: firefly_0821_release~3680^2~2200^2~3 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=62b259d8b3ea9d4a73108fc599e40c863ec25ae6;p=firefly-linux-kernel-4.4.55.git vfs: atomic_open(): fix create mode usage Don't mask S_ISREG off the create mode before passing to ->atomic_open(). Other methods (->create, ->mknod) also get the complete file mode and filesystems expect it. Reported-by: Steve Reported-by: Richard W.M. Jones Signed-off-by: Miklos Szeredi Tested-by: Richard W.M. Jones --- diff --git a/fs/namei.c b/fs/namei.c index 1b464390dde8..5bac1bb6e585 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -2414,7 +2414,7 @@ static int atomic_open(struct nameidata *nd, struct dentry *dentry, goto out; } - mode = op->mode & S_IALLUGO; + mode = op->mode; if ((open_flag & O_CREAT) && !IS_POSIXACL(dir)) mode &= ~current_umask();