Merge branch 'misc.namei' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[linux-2.6-microblaze.git] / fs / ceph / mds_client.c
index d010c24..7cad180 100644 (file)
@@ -653,14 +653,9 @@ const char *ceph_session_state_name(int s)
 
 struct ceph_mds_session *ceph_get_mds_session(struct ceph_mds_session *s)
 {
-       if (refcount_inc_not_zero(&s->s_ref)) {
-               dout("mdsc get_session %p %d -> %d\n", s,
-                    refcount_read(&s->s_ref)-1, refcount_read(&s->s_ref));
+       if (refcount_inc_not_zero(&s->s_ref))
                return s;
-       } else {
-               dout("mdsc get_session %p 0 -- FAIL\n", s);
-               return NULL;
-       }
+       return NULL;
 }
 
 void ceph_put_mds_session(struct ceph_mds_session *s)
@@ -668,8 +663,6 @@ void ceph_put_mds_session(struct ceph_mds_session *s)
        if (IS_ERR_OR_NULL(s))
                return;
 
-       dout("mdsc put_session %p %d -> %d\n", s,
-            refcount_read(&s->s_ref), refcount_read(&s->s_ref)-1);
        if (refcount_dec_and_test(&s->s_ref)) {
                if (s->s_auth.authorizer)
                        ceph_auth_destroy_authorizer(s->s_auth.authorizer);
@@ -2016,7 +2009,7 @@ static int trim_caps_cb(struct inode *inode, struct ceph_cap *cap, void *arg)
 
        if (oissued) {
                /* we aren't the only cap.. just remove us */
-               __ceph_remove_cap(cap, true);
+               ceph_remove_cap(cap, true);
                (*remaining)--;
        } else {
                struct dentry *dentry;
@@ -4541,6 +4534,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 +4544,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: