ソースを参照

nfs: fix error handling in lock_and_join_requests

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>
Weston Andros Adamson 11 年 前
コミット
94970014c4
1 ファイル変更4 行追加1 行削除
  1. 4 1
      fs/nfs/write.c

+ 4 - 1
fs/nfs/write.c

@@ -480,8 +480,11 @@ try_again:
 
 
 	/* 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 {
 		/*
 		/*