ceph: don't WARN if we're still opening a session to an MDS

If MDSs aren't available while mounting a filesystem, the session state
will transition from SESSION_OPENING to SESSION_CLOSING.  And in that
scenario check_session_state() will be called from delayed_work() and
trigger this WARN.

Avoid this by only WARNing after a session has already been established
(i.e., the s_ttl will be different from 0).

Fixes: 62575e270f ("ceph: check session state after bumping session->s_seq")
Signed-off-by: Luis Henriques <lhenriques@suse.de>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
This commit is contained in:
Luis Henriques 2021-07-15 14:40:39 +01:00 committed by Ilya Dryomov
parent ed9eb71085
commit cdb330f4b4
1 changed files with 1 additions and 1 deletions

View File

@ -4456,7 +4456,7 @@ bool check_session_state(struct ceph_mds_session *s)
break; break;
case CEPH_MDS_SESSION_CLOSING: case CEPH_MDS_SESSION_CLOSING:
/* Should never reach this when we're unmounting */ /* Should never reach this when we're unmounting */
WARN_ON_ONCE(true); WARN_ON_ONCE(s->s_ttl);
fallthrough; fallthrough;
case CEPH_MDS_SESSION_NEW: case CEPH_MDS_SESSION_NEW:
case CEPH_MDS_SESSION_RESTARTING: case CEPH_MDS_SESSION_RESTARTING: