summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorWeston Andros Adamson <dros@primarydata.com>2014-09-15 14:14:42 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-10-05 13:41:01 -0700
commitae3f3485448578097a115f341733d938c357c46b (patch)
treeda9f4fd4fe294209b490135b17df9dc8dc099a28 /fs
parent4a2025db17aa8646bdbc318da56e2729d6431b47 (diff)
nfs: fix error handling in lock_and_join_requests
commit 94970014c46223cbcdfbfc67b89596a412f9e3dd 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: Peng Tao <tao.peng@primarydata.com> Signed-off-by: Weston Andros Adamson <dros@primarydata.com> Reviewed-by: Peng Tao <tao.peng@primarydata.com> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/write.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index c8eb14eb6659..014d23c7d16e 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -455,8 +455,11 @@ try_again:
/* 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 {
/*