return;
        }
        idr_remove(&clp->cl_stateids, s->sc_stateid.si_opaque.so_id);
+       if (s->sc_status & SC_STATUS_ADMIN_REVOKED)
+               atomic_dec(&s->sc_client->cl_admin_revoked);
        nfs4_free_cpntf_statelist(clp->net, s);
        spin_unlock(&clp->cl_lock);
        s->sc_free(s);
        }
 
        idr_remove(&clp->cl_stateids, s->sc_stateid.si_opaque.so_id);
+       if (s->sc_status & SC_STATUS_ADMIN_REVOKED)
+               atomic_dec(&s->sc_client->cl_admin_revoked);
        list_add(&stp->st_locks, reaplist);
 }
 
        nfs4_put_stateowner(&oo->oo_owner);
 }
 
+static struct nfs4_stid *find_one_sb_stid(struct nfs4_client *clp,
+                                         struct super_block *sb,
+                                         unsigned int sc_types)
+{
+       unsigned long id, tmp;
+       struct nfs4_stid *stid;
+
+       spin_lock(&clp->cl_lock);
+       idr_for_each_entry_ul(&clp->cl_stateids, stid, tmp, id)
+               if ((stid->sc_type & sc_types) &&
+                   stid->sc_status == 0 &&
+                   stid->sc_file->fi_inode->i_sb == sb) {
+                       refcount_inc(&stid->sc_count);
+                       break;
+               }
+       spin_unlock(&clp->cl_lock);
+       return stid;
+}
+
+/**
+ * nfsd4_revoke_states - revoke all nfsv4 states associated with given filesystem
+ * @net:  used to identify instance of nfsd (there is one per net namespace)
+ * @sb:   super_block used to identify target filesystem
+ *
+ * All nfs4 states (open, lock, delegation, layout) held by the server instance
+ * and associated with a file on the given filesystem will be revoked resulting
+ * in any files being closed and so all references from nfsd to the filesystem
+ * being released.  Thus nfsd will no longer prevent the filesystem from being
+ * unmounted.
+ *
+ * The clients which own the states will subsequently being notified that the
+ * states have been "admin-revoked".
+ */
+void nfsd4_revoke_states(struct net *net, struct super_block *sb)
+{
+       struct nfsd_net *nn = net_generic(net, nfsd_net_id);
+       unsigned int idhashval;
+       unsigned int sc_types;
+
+       sc_types = 0;
+
+       spin_lock(&nn->client_lock);
+       for (idhashval = 0; idhashval < CLIENT_HASH_MASK; idhashval++) {
+               struct list_head *head = &nn->conf_id_hashtbl[idhashval];
+               struct nfs4_client *clp;
+       retry:
+               list_for_each_entry(clp, head, cl_idhash) {
+                       struct nfs4_stid *stid = find_one_sb_stid(clp, sb,
+                                                                 sc_types);
+                       if (stid) {
+                               spin_unlock(&nn->client_lock);
+                               switch (stid->sc_type) {
+                               }
+                               nfs4_put_stid(stid);
+                               spin_lock(&nn->client_lock);
+                               goto retry;
+                       }
+               }
+       }
+       spin_unlock(&nn->client_lock);
+}
+
 static inline int
 hash_sessionid(struct nfs4_sessionid *sessionid)
 {
        }
        seq_printf(m, "callback state: %s\n", cb_state2str(clp->cl_cb_state));
        seq_printf(m, "callback address: %pISpc\n", &clp->cl_cb_conn.cb_addr);
+       seq_printf(m, "admin-revoked states: %d\n",
+                  atomic_read(&clp->cl_admin_revoked));
        drop_client(clp);
 
        return 0;
        }
        if (!list_empty(&clp->cl_revoked))
                seq->status_flags |= SEQ4_STATUS_RECALLABLE_STATE_REVOKED;
+       if (atomic_read(&clp->cl_admin_revoked))
+               seq->status_flags |= SEQ4_STATUS_ADMIN_STATE_REVOKED;
        trace_nfsd_seq4_status(rqstp, seq);
 out_no_session:
        if (conn)
 {
        __be32 ret = nfs_ok;
 
-       if (s->sc_status & SC_STATUS_REVOKED)
+       if (s->sc_status & SC_STATUS_ADMIN_REVOKED)
+               ret = nfserr_admin_revoked;
+       else if (s->sc_status & SC_STATUS_REVOKED)
                ret = nfserr_deleg_revoked;
        else if (s->sc_status & SC_STATUS_CLOSED)
                ret = nfserr_bad_stateid;
        deleg = find_deleg_stateid(cl, &open->op_delegate_stateid);
        if (deleg == NULL)
                goto out;
+       if (deleg->dl_stid.sc_status & SC_STATUS_ADMIN_REVOKED) {
+               nfs4_put_stid(&deleg->dl_stid);
+               status = nfserr_admin_revoked;
+               goto out;
+       }
        if (deleg->dl_stid.sc_status & SC_STATUS_REVOKED) {
                nfs4_put_stid(&deleg->dl_stid);
                status = nfserr_deleg_revoked;
                 */
                statusmask |= SC_STATUS_REVOKED;
 
+       statusmask |= SC_STATUS_ADMIN_REVOKED;
+
        if (ZERO_STATEID(stateid) || ONE_STATEID(stateid) ||
                CLOSE_STATEID(stateid))
                return nfserr_bad_stateid;
                nfs4_put_stid(stid);
                return nfserr_deleg_revoked;
        }
+       if (stid->sc_status & SC_STATUS_ADMIN_REVOKED) {
+               nfs4_put_stid(stid);
+               return nfserr_admin_revoked;
+       }
        *s = stid;
        return nfs_ok;
 }
 
 #define SC_STATUS_CLOSED       BIT(0)
 /* For a deleg stateid kept around only to process free_stateid's: */
 #define SC_STATUS_REVOKED      BIT(1)
+#define SC_STATUS_ADMIN_REVOKED        BIT(2)
        unsigned short          sc_status;
 
        struct list_head        sc_cp_list;
        clientid_t              cl_clientid;    /* generated by server */
        nfs4_verifier           cl_confirm;     /* generated by server */
        u32                     cl_minorversion;
+       atomic_t                cl_admin_revoked; /* count of admin-revoked states */
        /* NFSv4.1 client implementation id: */
        struct xdr_netobj       cl_nii_domain;
        struct xdr_netobj       cl_nii_name;
 }
 struct nfsd_file *find_any_file(struct nfs4_file *f);
 
+#ifdef CONFIG_NFSD_V4
+void nfsd4_revoke_states(struct net *net, struct super_block *sb);
+#else
+static inline void nfsd4_revoke_states(struct net *net, struct super_block *sb)
+{
+}
+#endif
+
 /* grace period management */
 void nfsd4_end_grace(struct nfsd_net *nn);