Commit 396ea168 authored by Xiubo Li's avatar Xiubo Li Committed by Ilya Dryomov
Browse files

ceph: remove incorrect session state check

Once the session is opened the s->s_ttl will be set, and when receiving
a new mdsmap and the MDS map is changed, it will be possibly will close
some sessions and open new ones. And then some sessions will be in
CLOSING state evening without unmounting.

URL: https://tracker.ceph.com/issues/54979


Signed-off-by: default avatarXiubo Li <xiubli@redhat.com>
Reviewed-by: default avatarJeff Layton <jlayton@kernel.org>
Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
parent 7f47f7f3
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -4434,8 +4434,6 @@ static void maybe_recover_session(struct ceph_mds_client *mdsc)

bool check_session_state(struct ceph_mds_session *s)
{
	struct ceph_fs_client *fsc = s->s_mdsc->fsc;

	switch (s->s_state) {
	case CEPH_MDS_SESSION_OPEN:
		if (s->s_ttl && time_after(jiffies, s->s_ttl)) {
@@ -4444,10 +4442,6 @@ bool check_session_state(struct ceph_mds_session *s)
		}
		break;
	case CEPH_MDS_SESSION_CLOSING:
		/* Should never reach this when not force unmounting */
		WARN_ON_ONCE(s->s_ttl &&
			     READ_ONCE(fsc->mount_state) != CEPH_MOUNT_SHUTDOWN);
		fallthrough;
	case CEPH_MDS_SESSION_NEW:
	case CEPH_MDS_SESSION_RESTARTING:
	case CEPH_MDS_SESSION_CLOSED: