Skip to content

Commit

Permalink
nfs: fix error handling in lock_and_join_requests
Browse files Browse the repository at this point in the history
This fixes handling of errors from nfs_page_group_lock in
nfs_lock_and_join_requests.  It now releases the inode lock and the
reference to the head request.

Reported-by: Peng Tao <[email protected]>
Signed-off-by: Weston Andros Adamson <[email protected]>
Reviewed-by: Peng Tao <[email protected]>
Signed-off-by: Trond Myklebust <[email protected]>
  • Loading branch information
westonandrosadamson authored and trondmypd committed Aug 22, 2014
1 parent bfd484a commit 9497001
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fs/nfs/write.c
Original file line number Diff line number Diff line change
Expand Up @@ -480,8 +480,11 @@ nfs_lock_and_join_requests(struct page *page, bool nonblock)

/* lock each request in the page group */
ret = nfs_page_group_lock(head, true);
if (ret < 0)
if (ret < 0) {
spin_unlock(&inode->i_lock);
nfs_release_request(head);
return ERR_PTR(ret);
}
subreq = head;
do {
/*
Expand Down

0 comments on commit 9497001

Please sign in to comment.