NFSv4: Fix stateid recovery on revoked delegations
authorTrond Myklebust <trond.myklebust@primarydata.com>
Tue, 16 Jun 2015 15:26:35 +0000 (11:26 -0400)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Tue, 16 Jun 2015 15:29:51 +0000 (11:29 -0400)
Ensure that we fix the non-NULL stateid case as well.

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
fs/nfs/nfs4proc.c

index 6bcdecd61125b9d74695760a0e2f9e4dfae58322..0fc1b0cdda98eb341acc568791a99363e9ad6fc7 100644 (file)
@@ -356,6 +356,9 @@ int nfs4_handle_exception(struct nfs_server *server, int errorcode, struct nfs4_
                case 0:
                        return 0;
                case -NFS4ERR_OPENMODE:
+               case -NFS4ERR_DELEG_REVOKED:
+               case -NFS4ERR_ADMIN_REVOKED:
+               case -NFS4ERR_BAD_STATEID:
                        if (inode && nfs4_have_delegation(inode, FMODE_READ)) {
                                nfs4_inode_return_delegation(inode);
                                exception->retry = 1;
@@ -367,21 +370,6 @@ int nfs4_handle_exception(struct nfs_server *server, int errorcode, struct nfs4_
                        if (ret < 0)
                                break;
                        goto wait_on_recovery;
-               case -NFS4ERR_DELEG_REVOKED:
-               case -NFS4ERR_ADMIN_REVOKED:
-               case -NFS4ERR_BAD_STATEID:
-                       if (state == NULL) {
-                               if (inode && nfs4_have_delegation(inode,
-                                               FMODE_READ)) {
-                                       nfs4_inode_return_delegation(inode);
-                                       exception->retry = 1;
-                               }
-                               break;
-                       }
-                       ret = nfs4_schedule_stateid_recovery(server, state);
-                       if (ret < 0)
-                               break;
-                       goto wait_on_recovery;
                case -NFS4ERR_EXPIRED:
                        if (state != NULL) {
                                ret = nfs4_schedule_stateid_recovery(server, state);