|
@@ -2414,7 +2414,7 @@ static int atomic_open(struct nameidata *nd, struct dentry *dentry,
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
|
|
|
|
- mode = op->mode & S_IALLUGO;
|
|
|
|
|
|
+ mode = op->mode;
|
|
if ((open_flag & O_CREAT) && !IS_POSIXACL(dir))
|
|
if ((open_flag & O_CREAT) && !IS_POSIXACL(dir))
|
|
mode &= ~current_umask();
|
|
mode &= ~current_umask();
|
|
|
|
|
|
@@ -2452,7 +2452,7 @@ static int atomic_open(struct nameidata *nd, struct dentry *dentry,
|
|
}
|
|
}
|
|
|
|
|
|
if (open_flag & O_CREAT) {
|
|
if (open_flag & O_CREAT) {
|
|
- error = may_o_create(&nd->path, dentry, op->mode);
|
|
|
|
|
|
+ error = may_o_create(&nd->path, dentry, mode);
|
|
if (error) {
|
|
if (error) {
|
|
create_error = error;
|
|
create_error = error;
|
|
if (open_flag & O_EXCL)
|
|
if (open_flag & O_EXCL)
|
|
@@ -2489,6 +2489,10 @@ static int atomic_open(struct nameidata *nd, struct dentry *dentry,
|
|
dput(dentry);
|
|
dput(dentry);
|
|
dentry = file->f_path.dentry;
|
|
dentry = file->f_path.dentry;
|
|
}
|
|
}
|
|
|
|
+ if (create_error && dentry->d_inode == NULL) {
|
|
|
|
+ error = create_error;
|
|
|
|
+ goto out;
|
|
|
|
+ }
|
|
goto looked_up;
|
|
goto looked_up;
|
|
}
|
|
}
|
|
|
|
|