diff options
author | Xiubo Li <xiubli@redhat.com> | 2021-08-25 21:45:44 +0800 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2021-09-02 22:49:17 +0200 |
commit | 42ad631b4d0e0d6da0bfe375af99887251fbf970 (patch) | |
tree | aa56d3dbce1a75fb9c2a6d7b88f330638d053bf5 /fs/ceph | |
parent | a6d37ccdd240e80f26aaea0e62cda310e0e184d7 (diff) |
ceph: don't WARN if we're force umounting
Force umount will try to close the sessions by setting the session
state to _CLOSING. We don't want to WARN in this situation, since it's
expected.
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')
-rw-r--r-- | fs/ceph/mds_client.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index d010c24456ef..c3a0e549c413 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c @@ -4541,6 +4541,8 @@ 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)) { @@ -4549,8 +4551,9 @@ bool check_session_state(struct ceph_mds_session *s) } break; case CEPH_MDS_SESSION_CLOSING: - /* Should never reach this when we're unmounting */ - WARN_ON_ONCE(s->s_ttl); + /* 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: |