Loading fs/namei.c +7 −5 Original line number Original line Diff line number Diff line Loading @@ -2069,11 +2069,7 @@ out_unlock: mutex_unlock(&dir->d_inode->i_mutex); mutex_unlock(&dir->d_inode->i_mutex); dput(nd->path.dentry); dput(nd->path.dentry); nd->path.dentry = path->dentry; nd->path.dentry = path->dentry; if (error) return error; return error; /* Don't check for write permission, don't truncate */ return may_open(&nd->path, 0, open_flag & ~O_TRUNC); } } /* /* Loading Loading @@ -2239,6 +2235,12 @@ static struct file *do_last(struct nameidata *nd, struct path *path, mnt_drop_write(nd->path.mnt); mnt_drop_write(nd->path.mnt); goto exit; goto exit; } } /* Don't check for write permission, don't truncate */ error = may_open(&nd->path, 0, op->open_flag & ~O_TRUNC); if (error) { mnt_drop_write(nd->path.mnt); goto exit; } filp = nameidata_to_filp(nd); filp = nameidata_to_filp(nd); mnt_drop_write(nd->path.mnt); mnt_drop_write(nd->path.mnt); path_put(&nd->path); path_put(&nd->path); Loading Loading
fs/namei.c +7 −5 Original line number Original line Diff line number Diff line Loading @@ -2069,11 +2069,7 @@ out_unlock: mutex_unlock(&dir->d_inode->i_mutex); mutex_unlock(&dir->d_inode->i_mutex); dput(nd->path.dentry); dput(nd->path.dentry); nd->path.dentry = path->dentry; nd->path.dentry = path->dentry; if (error) return error; return error; /* Don't check for write permission, don't truncate */ return may_open(&nd->path, 0, open_flag & ~O_TRUNC); } } /* /* Loading Loading @@ -2239,6 +2235,12 @@ static struct file *do_last(struct nameidata *nd, struct path *path, mnt_drop_write(nd->path.mnt); mnt_drop_write(nd->path.mnt); goto exit; goto exit; } } /* Don't check for write permission, don't truncate */ error = may_open(&nd->path, 0, op->open_flag & ~O_TRUNC); if (error) { mnt_drop_write(nd->path.mnt); goto exit; } filp = nameidata_to_filp(nd); filp = nameidata_to_filp(nd); mnt_drop_write(nd->path.mnt); mnt_drop_write(nd->path.mnt); path_put(&nd->path); path_put(&nd->path); Loading