Commit ae3f3485 authored by Weston Andros Adamson's avatar Weston Andros Adamson Committed by Greg Kroah-Hartman

nfs: fix error handling in lock_and_join_requests

commit 94970014 upstream.

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: default avatarPeng Tao <tao.peng@primarydata.com>
Signed-off-by: default avatarWeston Andros Adamson <dros@primarydata.com>
Reviewed-by: default avatarPeng Tao <tao.peng@primarydata.com>
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4a2025db
...@@ -455,8 +455,11 @@ nfs_lock_and_join_requests(struct page *page, bool nonblock) ...@@ -455,8 +455,11 @@ nfs_lock_and_join_requests(struct page *page, bool nonblock)
/* lock each request in the page group */ /* lock each request in the page group */
ret = nfs_page_group_lock(head, true); 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); return ERR_PTR(ret);
}
subreq = head; subreq = head;
do { do {
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment