aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/direct.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2012-04-30 13:40:06 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-04-30 14:33:51 -0400
commit3e9e0ca3f19e911ce13c2e6c9858fcb41a37496c (patch)
tree714ead9c8f9fb7334b876717f85aa80b33be8871 /fs/nfs/direct.c
parent71e8cc00c63e8518ce86b4079355fc9086a4869d (diff)
NFS: O_DIRECT pgio_completion_ops error_cleanup must unlock the request
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: Fred Isaman <iisaman@netapp.com>
Diffstat (limited to 'fs/nfs/direct.c')
-rw-r--r--fs/nfs/direct.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c
index f30d5c26a763..af02bde7741e 100644
--- a/fs/nfs/direct.c
+++ b/fs/nfs/direct.c
@@ -292,7 +292,7 @@ out_put:
292 hdr->release(hdr); 292 hdr->release(hdr);
293} 293}
294 294
295static void nfs_sync_pgio_error(struct list_head *head) 295static void nfs_read_sync_pgio_error(struct list_head *head)
296{ 296{
297 struct nfs_page *req; 297 struct nfs_page *req;
298 298
@@ -309,7 +309,7 @@ static void nfs_direct_pgio_init(struct nfs_pgio_header *hdr)
309} 309}
310 310
311static const struct nfs_pgio_completion_ops nfs_direct_read_completion_ops = { 311static const struct nfs_pgio_completion_ops nfs_direct_read_completion_ops = {
312 .error_cleanup = nfs_sync_pgio_error, 312 .error_cleanup = nfs_read_sync_pgio_error,
313 .init_hdr = nfs_direct_pgio_init, 313 .init_hdr = nfs_direct_pgio_init,
314 .completion = nfs_direct_read_completion, 314 .completion = nfs_direct_read_completion,
315}; 315};
@@ -775,8 +775,20 @@ out_put:
775 hdr->release(hdr); 775 hdr->release(hdr);
776} 776}
777 777
778static void nfs_write_sync_pgio_error(struct list_head *head)
779{
780 struct nfs_page *req;
781
782 while (!list_empty(head)) {
783 req = nfs_list_entry(head->next);
784 nfs_list_remove_request(req);
785 nfs_release_request(req);
786 nfs_unlock_request(req);
787 }
788}
789
778static const struct nfs_pgio_completion_ops nfs_direct_write_completion_ops = { 790static const struct nfs_pgio_completion_ops nfs_direct_write_completion_ops = {
779 .error_cleanup = nfs_sync_pgio_error, 791 .error_cleanup = nfs_write_sync_pgio_error,
780 .init_hdr = nfs_direct_pgio_init, 792 .init_hdr = nfs_direct_pgio_init,
781 .completion = nfs_direct_write_completion, 793 .completion = nfs_direct_write_completion,
782}; 794};