diff options
Diffstat (limited to 'fs/nfs/direct.c')
-rw-r--r-- | fs/nfs/direct.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c index ad2775d3e219..9a4cbfc85d81 100644 --- a/fs/nfs/direct.c +++ b/fs/nfs/direct.c | |||
@@ -490,6 +490,7 @@ static void nfs_direct_write_reschedule(struct nfs_direct_req *dreq) | |||
490 | dreq->error = -EIO; | 490 | dreq->error = -EIO; |
491 | spin_unlock(cinfo.lock); | 491 | spin_unlock(cinfo.lock); |
492 | } | 492 | } |
493 | nfs_release_request(req); | ||
493 | } | 494 | } |
494 | nfs_pageio_complete(&desc); | 495 | nfs_pageio_complete(&desc); |
495 | 496 | ||
@@ -523,9 +524,9 @@ static void nfs_direct_commit_complete(struct nfs_commit_data *data) | |||
523 | nfs_list_remove_request(req); | 524 | nfs_list_remove_request(req); |
524 | if (dreq->flags == NFS_ODIRECT_RESCHED_WRITES) { | 525 | if (dreq->flags == NFS_ODIRECT_RESCHED_WRITES) { |
525 | /* Note the rewrite will go through mds */ | 526 | /* Note the rewrite will go through mds */ |
526 | kref_get(&req->wb_kref); | ||
527 | nfs_mark_request_commit(req, NULL, &cinfo); | 527 | nfs_mark_request_commit(req, NULL, &cinfo); |
528 | } | 528 | } else |
529 | nfs_release_request(req); | ||
529 | nfs_unlock_and_release_request(req); | 530 | nfs_unlock_and_release_request(req); |
530 | } | 531 | } |
531 | 532 | ||
@@ -716,12 +717,12 @@ static void nfs_direct_write_completion(struct nfs_pgio_header *hdr) | |||
716 | if (dreq->flags == NFS_ODIRECT_RESCHED_WRITES) | 717 | if (dreq->flags == NFS_ODIRECT_RESCHED_WRITES) |
717 | bit = NFS_IOHDR_NEED_RESCHED; | 718 | bit = NFS_IOHDR_NEED_RESCHED; |
718 | else if (dreq->flags == 0) { | 719 | else if (dreq->flags == 0) { |
719 | memcpy(&dreq->verf, &req->wb_verf, | 720 | memcpy(&dreq->verf, hdr->verf, |
720 | sizeof(dreq->verf)); | 721 | sizeof(dreq->verf)); |
721 | bit = NFS_IOHDR_NEED_COMMIT; | 722 | bit = NFS_IOHDR_NEED_COMMIT; |
722 | dreq->flags = NFS_ODIRECT_DO_COMMIT; | 723 | dreq->flags = NFS_ODIRECT_DO_COMMIT; |
723 | } else if (dreq->flags == NFS_ODIRECT_DO_COMMIT) { | 724 | } else if (dreq->flags == NFS_ODIRECT_DO_COMMIT) { |
724 | if (memcmp(&dreq->verf, &req->wb_verf, sizeof(dreq->verf))) { | 725 | if (memcmp(&dreq->verf, hdr->verf, sizeof(dreq->verf))) { |
725 | dreq->flags = NFS_ODIRECT_RESCHED_WRITES; | 726 | dreq->flags = NFS_ODIRECT_RESCHED_WRITES; |
726 | bit = NFS_IOHDR_NEED_RESCHED; | 727 | bit = NFS_IOHDR_NEED_RESCHED; |
727 | } else | 728 | } else |