]> git.baikalelectronics.ru Git - kernel.git/commit
ceph: take reference to req->r_parent at point of assignment
authorJeff Layton <jlayton@kernel.org>
Fri, 18 Jun 2021 17:05:06 +0000 (13:05 -0400)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 28 Jun 2021 22:15:52 +0000 (00:15 +0200)
commit5282db23b7c4f700fae868fc71b5b9e098980326
treeb6ab8e47ccb7d6e50ea4a5ccdf4aba6bd50133b1
parentcd333e4bbdc1d89827ff814d46f977675d88cb96
ceph: take reference to req->r_parent at point of assignment

Currently, we set the r_parent pointer but then don't take a reference
to it until we submit the request. If we end up freeing the req before
that point, then we'll do a iput when we shouldn't.

Instead, take the inode reference in the callers, so that it's always
safe to call ceph_mdsc_put_request on the req, even before submission.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Luis Henriques <lhenriques@suse.de>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
fs/ceph/dir.c
fs/ceph/export.c
fs/ceph/file.c
fs/ceph/mds_client.c