Skip to content

Commit 42ad631

Browse files
lxbszidryomov
authored andcommitted
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 <[email protected]> Reviewed-by: Jeff Layton <[email protected]> Signed-off-by: Ilya Dryomov <[email protected]>
1 parent a6d37cc commit 42ad631

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

fs/ceph/mds_client.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4541,6 +4541,8 @@ static void maybe_recover_session(struct ceph_mds_client *mdsc)
45414541

45424542
bool check_session_state(struct ceph_mds_session *s)
45434543
{
4544+
struct ceph_fs_client *fsc = s->s_mdsc->fsc;
4545+
45444546
switch (s->s_state) {
45454547
case CEPH_MDS_SESSION_OPEN:
45464548
if (s->s_ttl && time_after(jiffies, s->s_ttl)) {
@@ -4549,8 +4551,9 @@ bool check_session_state(struct ceph_mds_session *s)
45494551
}
45504552
break;
45514553
case CEPH_MDS_SESSION_CLOSING:
4552-
/* Should never reach this when we're unmounting */
4553-
WARN_ON_ONCE(s->s_ttl);
4554+
/* Should never reach this when not force unmounting */
4555+
WARN_ON_ONCE(s->s_ttl &&
4556+
READ_ONCE(fsc->mount_state) != CEPH_MOUNT_SHUTDOWN);
45544557
fallthrough;
45554558
case CEPH_MDS_SESSION_NEW:
45564559
case CEPH_MDS_SESSION_RESTARTING:

0 commit comments

Comments
 (0)