aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4filelayout.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2013-03-18 19:45:14 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2013-03-25 12:04:10 -0400
commitc58c844187df61ef7cc103d0abb5dd6198bcfcd6 (patch)
tree0e435c37318e290346f3bed74bba05350ec4dd2f /fs/nfs/nfs4filelayout.c
parent5d422301f97b821301efcdb6fc9d1a83a5c102d6 (diff)
NFS: Don't accept more reads/writes if the open context recovery failed
If the state recovery failed, we want to ensure that the application doesn't try to use the same file descriptor for more reads or writes. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4filelayout.c')
-rw-r--r--fs/nfs/nfs4filelayout.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c
index 1ee5737211d7..4ba32e23eddd 100644
--- a/fs/nfs/nfs4filelayout.c
+++ b/fs/nfs/nfs4filelayout.c
@@ -305,6 +305,10 @@ static void filelayout_read_prepare(struct rpc_task *task, void *data)
305{ 305{
306 struct nfs_read_data *rdata = data; 306 struct nfs_read_data *rdata = data;
307 307
308 if (unlikely(test_bit(NFS_CONTEXT_BAD, &rdata->args.context->flags))) {
309 rpc_exit(task, -EIO);
310 return;
311 }
308 if (filelayout_reset_to_mds(rdata->header->lseg)) { 312 if (filelayout_reset_to_mds(rdata->header->lseg)) {
309 dprintk("%s task %u reset io to MDS\n", __func__, task->tk_pid); 313 dprintk("%s task %u reset io to MDS\n", __func__, task->tk_pid);
310 filelayout_reset_read(rdata); 314 filelayout_reset_read(rdata);
@@ -407,6 +411,10 @@ static void filelayout_write_prepare(struct rpc_task *task, void *data)
407{ 411{
408 struct nfs_write_data *wdata = data; 412 struct nfs_write_data *wdata = data;
409 413
414 if (unlikely(test_bit(NFS_CONTEXT_BAD, &wdata->args.context->flags))) {
415 rpc_exit(task, -EIO);
416 return;
417 }
410 if (filelayout_reset_to_mds(wdata->header->lseg)) { 418 if (filelayout_reset_to_mds(wdata->header->lseg)) {
411 dprintk("%s task %u reset io to MDS\n", __func__, task->tk_pid); 419 dprintk("%s task %u reset io to MDS\n", __func__, task->tk_pid);
412 filelayout_reset_write(wdata); 420 filelayout_reset_write(wdata);