aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/nfs/direct.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c
index b1c98ea39b72..2877744cb606 100644
--- a/fs/nfs/direct.c
+++ b/fs/nfs/direct.c
@@ -432,10 +432,10 @@ static void nfs_direct_commit_result(struct rpc_task *task, void *calldata)
432 if (NFS_PROTO(data->inode)->commit_done(task, data) != 0) 432 if (NFS_PROTO(data->inode)->commit_done(task, data) != 0)
433 return; 433 return;
434 if (unlikely(task->tk_status < 0)) { 434 if (unlikely(task->tk_status < 0)) {
435 dreq->error = task->tk_status; 435 dprintk("NFS: %5u commit failed with error %d.\n",
436 task->tk_pid, task->tk_status);
436 dreq->flags = NFS_ODIRECT_RESCHED_WRITES; 437 dreq->flags = NFS_ODIRECT_RESCHED_WRITES;
437 } 438 } else if (memcmp(&dreq->verf, &data->verf, sizeof(data->verf))) {
438 if (memcmp(&dreq->verf, &data->verf, sizeof(data->verf))) {
439 dprintk("NFS: %5u commit verify failed\n", task->tk_pid); 439 dprintk("NFS: %5u commit verify failed\n", task->tk_pid);
440 dreq->flags = NFS_ODIRECT_RESCHED_WRITES; 440 dreq->flags = NFS_ODIRECT_RESCHED_WRITES;
441 } 441 }
@@ -531,9 +531,12 @@ static void nfs_direct_write_result(struct rpc_task *task, void *calldata)
531 531
532 spin_lock(&dreq->lock); 532 spin_lock(&dreq->lock);
533 533
534 if (unlikely(dreq->error != 0))
535 goto out_unlock;
534 if (unlikely(status < 0)) { 536 if (unlikely(status < 0)) {
537 /* An error has occured, so we should not commit */
538 dreq->flags = 0;
535 dreq->error = status; 539 dreq->error = status;
536 goto out_unlock;
537 } 540 }
538 541
539 dreq->count += data->res.count; 542 dreq->count += data->res.count;