patch-5.15.79-rt54.patch
[platform/kernel/linux-rpi.git] / fs / namei.c
index 2ea15d0..71c0b93 100644 (file)
@@ -1461,6 +1461,8 @@ static bool __follow_mount_rcu(struct nameidata *nd, struct path *path,
                                 * becoming unpinned.
                                 */
                                flags = dentry->d_flags;
+                               if (read_seqretry(&mount_lock, nd->m_seq))
+                                       return false;
                                continue;
                        }
                        if (read_seqretry(&mount_lock, nd->m_seq))
@@ -1633,7 +1635,7 @@ static struct dentry *__lookup_slow(const struct qstr *name,
 {
        struct dentry *dentry, *old;
        struct inode *inode = dir->d_inode;
-       DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wq);
+       DECLARE_SWAIT_QUEUE_HEAD_ONSTACK(wq);
 
        /* Don't go there if it's already dead */
        if (unlikely(IS_DEADDIR(inode)))
@@ -3244,7 +3246,7 @@ static struct dentry *lookup_open(struct nameidata *nd, struct file *file,
        struct dentry *dentry;
        int error, create_error = 0;
        umode_t mode = op->mode;
-       DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wq);
+       DECLARE_SWAIT_QUEUE_HEAD_ONSTACK(wq);
 
        if (unlikely(IS_DEADDIR(dir_inode)))
                return ERR_PTR(-ENOENT);
@@ -3523,6 +3525,8 @@ struct dentry *vfs_tmpfile(struct user_namespace *mnt_userns,
        child = d_alloc(dentry, &slash_name);
        if (unlikely(!child))
                goto out_err;
+       if (!IS_POSIXACL(dir))
+               mode &= ~current_umask();
        error = dir->i_op->tmpfile(mnt_userns, dir, child, mode);
        if (error)
                goto out_err;