]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - fs/ceph/dir.c
ceph: fix security xattr deadlock
[mirror_ubuntu-bionic-kernel.git] / fs / ceph / dir.c
index fd11fb231a2ea796e86eae933265a488ad6774e5..b9f50a388aee30d9b341c90c736d4eee0e3f7510 100644 (file)
@@ -624,6 +624,7 @@ static struct dentry *ceph_lookup(struct inode *dir, struct dentry *dentry,
        struct ceph_mds_client *mdsc = fsc->mdsc;
        struct ceph_mds_request *req;
        int op;
+       int mask;
        int err;
 
        dout("lookup %p dentry %p '%pd'\n",
@@ -666,8 +667,12 @@ static struct dentry *ceph_lookup(struct inode *dir, struct dentry *dentry,
                return ERR_CAST(req);
        req->r_dentry = dget(dentry);
        req->r_num_caps = 2;
-       /* we only need inode linkage */
-       req->r_args.getattr.mask = cpu_to_le32(CEPH_STAT_CAP_INODE);
+
+       mask = CEPH_STAT_CAP_INODE | CEPH_CAP_AUTH_SHARED;
+       if (ceph_security_xattr_wanted(dir))
+               mask |= CEPH_CAP_XATTR_SHARED;
+       req->r_args.getattr.mask = cpu_to_le32(mask);
+
        req->r_locked_dir = dir;
        err = ceph_mdsc_do_request(mdsc, NULL, req);
        err = ceph_handle_snapdir(req, dentry, err);