NFSv4: Fix OPEN_DOWNGRADE error handling
authorTrond Myklebust <trondmy@gmail.com>
Fri, 20 Sep 2019 11:23:46 +0000 (07:23 -0400)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Fri, 20 Sep 2019 19:52:44 +0000 (15:52 -0400)
If OPEN_DOWNGRADE returns a state error, then we want to initiate
state recovery in addition to marking the stateid as closed.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
fs/nfs/nfs4proc.c

index 27964ea0b3b75997dcab230f557157490d57b106..9e283a8e8e93b4e0221cfe996a15a2925422c3af 100644 (file)
@@ -3399,7 +3399,9 @@ static void nfs4_close_done(struct rpc_task *task, void *data)
                                        task->tk_msg.rpc_cred);
                        /* Fallthrough */
                case -NFS4ERR_BAD_STATEID:
-                       break;
+                       if (calldata->arg.fmode == 0)
+                               break;
+                       /* Fallthrough */
                default:
                        task->tk_status = nfs4_async_handle_exception(task,
                                        server, task->tk_status, &exception);