spin_lock(&cl->cl_lock);
        s = find_stateid_locked(cl, t);
-       if (s != NULL && !(typemask & s->sc_type))
-               s = NULL;
+       if (s != NULL) {
+               if (typemask & s->sc_type)
+                       atomic_inc(&s->sc_count);
+               else
+                       s = NULL;
+       }
        spin_unlock(&cl->cl_lock);
        return s;
 }
        ret = find_stateid_by_type(cl, s, NFS4_DELEG_STID);
        if (!ret)
                return NULL;
-       /* FIXME: move into find_stateid_by_type */
-       atomic_inc(&ret->sc_count);
        return delegstateid(ret);
 }
 
        *s = find_stateid_by_type(cstate->clp, stateid, typemask);
        if (!*s)
                return nfserr_bad_stateid;
-       /* FIXME: move into find_stateid_by_type */
-       atomic_inc(&(*s)->sc_count);
        return nfs_ok;
 }