Merge branch 'for-linus' into work.lookups

This commit is contained in:
Al Viro
2016-05-02 19:49:46 -04:00
5 changed files with 35 additions and 55 deletions

View File

@@ -2946,22 +2946,10 @@ no_open:
dentry = lookup_real(dir, dentry, nd->flags);
if (IS_ERR(dentry))
return PTR_ERR(dentry);
if (create_error) {
int open_flag = op->open_flag;
error = create_error;
if ((open_flag & O_EXCL)) {
if (!dentry->d_inode)
goto out;
} else if (!dentry->d_inode) {
goto out;
} else if ((open_flag & O_TRUNC) &&
d_is_reg(dentry)) {
goto out;
}
/* will fail later, go on to get the right error */
}
}
if (create_error && !dentry->d_inode) {
error = create_error;
goto out;
}
looked_up:
path->dentry = dentry;