Skip to content

Commit

Permalink
[PATCH] NFS: Fix oops in nfs_cancel_commit_list
Browse files Browse the repository at this point in the history
Fix two bugs:
 - nfs_inode_remove_request will call nfs_clear_request, so we cannot
   reference req->wb_page after it. Move the call to dec_zone_page_state so
   that it occurs while req->wb_page is still valid.
 - Calling nfs_clear_page_writeback is unnecessary since the radix tree
   tags will have been cleared by the call to nfs_inode_remove_request.
   Replace with a simple call to nfs_unlock_request.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Trond Myklebust authored and Linus Torvalds committed Oct 20, 2006
1 parent 575b5c7 commit b6dff26
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/nfs/write.c
Original file line number Diff line number Diff line change
Expand Up @@ -590,10 +590,10 @@ static void nfs_cancel_commit_list(struct list_head *head)

while(!list_empty(head)) {
req = nfs_list_entry(head->next);
dec_zone_page_state(req->wb_page, NR_UNSTABLE_NFS);
nfs_list_remove_request(req);
nfs_inode_remove_request(req);
dec_zone_page_state(req->wb_page, NR_UNSTABLE_NFS);
nfs_clear_page_writeback(req);
nfs_unlock_request(req);
}
}

Expand Down

0 comments on commit b6dff26

Please sign in to comment.