diff options
author | Trond Myklebust <trond.myklebust@hammerspace.com> | 2019-02-27 21:37:36 +0100 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@hammerspace.com> | 2019-03-01 22:20:16 +0100 |
commit | a79f194aa4879e9baad118c3f8bb2ca24dbef765 (patch) | |
tree | 202028379bf0ff4ac68952614d76ab434cf9da50 /net | |
parent | NFSv4/pnfs: Fix barriers in nfs4_mark_deviceid_unavailable() (diff) | |
download | linux-a79f194aa4879e9baad118c3f8bb2ca24dbef765.tar.xz linux-a79f194aa4879e9baad118c3f8bb2ca24dbef765.zip |
NFSv4/flexfiles: Abort I/O early if the layout segment was invalidated
If a layout segment gets invalidated while a pNFS I/O operation
is queued for transmission, then we ideally want to abort
immediately. This is particularly the case when there is a large
number of I/O related RPCs queued in the RPC layer, and the layout
segment gets invalidated due to an ENOSPC error, or an EACCES (because
the client was fenced). We may end up forced to spam the MDS with a
lot of otherwise unnecessary LAYOUTERRORs after that I/O fails.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/sunrpc/xprt.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c index 1cf4e379be7b..e096c5a725df 100644 --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c @@ -1330,6 +1330,13 @@ xprt_request_transmit(struct rpc_rqst *req, struct rpc_task *snd_task) status = -EBADMSG; goto out_dequeue; } + if (task->tk_ops->rpc_call_prepare_transmit) { + task->tk_ops->rpc_call_prepare_transmit(task, + task->tk_calldata); + status = task->tk_status; + if (status < 0) + goto out_dequeue; + } } /* |