summaryrefslogtreecommitdiff
path: root/fs/ceph/mds_client.h
diff options
context:
space:
mode:
authorXiubo Li <xiubli@redhat.com>2019-12-19 19:44:09 -0500
committerIlya Dryomov <idryomov@gmail.com>2020-01-27 16:53:40 +0100
commit5b3248c6772459a0737afe0c85bb45ee3ba79eeb (patch)
treef638b01f7a2358c80f39de61ff6fdb55b339a829 /fs/ceph/mds_client.h
parent4fbc0c711b2464ee1551850b85002faae0b775d5 (diff)
ceph: rename get_session and switch to use ceph_get_mds_session
Just in case the session's refcount reach 0 and is releasing, and if we get the session without checking it, we may encounter kernel crash. Rename get_session to ceph_get_mds_session and make it global. Signed-off-by: Xiubo Li <xiubli@redhat.com> Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph/mds_client.h')
-rw-r--r--fs/ceph/mds_client.h9
1 files changed, 2 insertions, 7 deletions
diff --git a/fs/ceph/mds_client.h b/fs/ceph/mds_client.h
index fe085e06adf5..c021df5f50ce 100644
--- a/fs/ceph/mds_client.h
+++ b/fs/ceph/mds_client.h
@@ -452,15 +452,10 @@ extern const char *ceph_mds_op_name(int op);
extern struct ceph_mds_session *
__ceph_lookup_mds_session(struct ceph_mds_client *, int mds);
-static inline struct ceph_mds_session *
-ceph_get_mds_session(struct ceph_mds_session *s)
-{
- refcount_inc(&s->s_ref);
- return s;
-}
-
extern const char *ceph_session_state_name(int s);
+extern struct ceph_mds_session *
+ceph_get_mds_session(struct ceph_mds_session *s);
extern void ceph_put_mds_session(struct ceph_mds_session *s);
extern int ceph_send_msg_mds(struct ceph_mds_client *mdsc,