summaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2017-07-17 16:11:11 +0200
committerTrond Myklebust <trond.myklebust@primarydata.com>2017-08-15 17:54:46 +0200
commit7cb9cd9aa2eafe869935d4168031f1ed376d924c (patch)
tree4c4c2028f5f65e0f5df1c0929a087e21eed7db21 /fs/nfs
parentNFS: Ensure we always dereference the page head last (diff)
downloadlinux-7cb9cd9aa2eafe869935d4168031f1ed376d924c.tar.xz
linux-7cb9cd9aa2eafe869935d4168031f1ed376d924c.zip
NFS: Fix a reference and lock leak in nfs_lock_and_join_requests()
Yes, this is a situation that should never happen (hence the WARN_ON) but we should still ensure that we free up the locks and references to the faulty pages. Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/write.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index bb019096c331..1ca759719429 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -526,8 +526,7 @@ try_again:
} else if (WARN_ON_ONCE(subreq->wb_offset < head->wb_offset ||
((subreq->wb_offset + subreq->wb_bytes) >
(head->wb_offset + total_bytes)))) {
- nfs_page_group_unlock(head);
- spin_unlock(&inode->i_lock);
+ nfs_unroll_locks_and_wait(inode, head, subreq);
return ERR_PTR(-EIO);
}