summaryrefslogtreecommitdiffstats
path: root/fs/ceph
diff options
context:
space:
mode:
authorJeff Layton2019-04-17 20:23:17 +0200
committerIlya Dryomov2019-05-07 19:22:37 +0200
commitc1dfc277239c73f68a6af6979acec1989a5e6864 (patch)
treefafa67ffb86d1023246ad304261d622c1a46bf4f /fs/ceph
parentceph: use __getname/__putname in ceph_mdsc_build_path (diff)
downloadkernel-qcow2-linux-c1dfc277239c73f68a6af6979acec1989a5e6864.tar.gz
kernel-qcow2-linux-c1dfc277239c73f68a6af6979acec1989a5e6864.tar.xz
kernel-qcow2-linux-c1dfc277239c73f68a6af6979acec1989a5e6864.zip
ceph: use pathlen values returned by set_request_path_attr
We make copies of the dentry name in set_request_path_attr, but then create_request_message re-fetches the lengths out of the dentry. While we don't currently set the *_drop fields unless the parents are locked, it's still better not to rely on that sort of implicit assumption. Use the pathlen values that set_request_path_attr returned instead, as they will always be correct for the returned paths themselves. Signed-off-by: Jeff Layton <jlayton@kernel.org> Reviewed-by: "Yan, Zheng" <zyan@redhat.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph')
-rw-r--r--fs/ceph/mds_client.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
index d29f6c094f7c..bfa1733c6336 100644
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -2288,9 +2288,9 @@ static struct ceph_msg *create_request_message(struct ceph_mds_client *mdsc,
(!!req->r_inode_drop + !!req->r_dentry_drop +
!!req->r_old_inode_drop + !!req->r_old_dentry_drop);
if (req->r_dentry_drop)
- len += req->r_dentry->d_name.len;
+ len += pathlen1;
if (req->r_old_dentry_drop)
- len += req->r_old_dentry->d_name.len;
+ len += pathlen2;
msg = ceph_msg_new2(CEPH_MSG_CLIENT_REQUEST, len, 1, GFP_NOFS, false);
if (!msg) {