ceph: just call get_session in __ceph_lookup_mds_session
authorJeff Layton <jlayton@kernel.org>
Wed, 24 Apr 2019 14:05:39 +0000 (10:05 -0400)
committerIlya Dryomov <idryomov@gmail.com>
Tue, 7 May 2019 17:22:38 +0000 (19:22 +0200)
commit488f5284e29b2dbb7c224d51b56fc20348e73735
tree78d4778770179e78350624efff6841ff5dd41d0e
parent1199d7da2d29dac5e3983ea1078dbd4ab107e33f
ceph: just call get_session in __ceph_lookup_mds_session

I originally thought there was a potential race here, but the fact
that this is called with the mdsc->mutex held, ensures that the
last reference to the session can't be put here.

Still, it's clearer to just return the value from get_session here,
and may prevent a bug later if we ever rework this code to be less
reliant on mutexes.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
fs/ceph/mds_client.c