summaryrefslogtreecommitdiffstats
path: root/fs/nfs/write.c
diff options
context:
space:
mode:
authorTrond Myklebust2017-07-17 16:11:11 +0200
committerTrond Myklebust2017-08-15 17:54:46 +0200
commit7cb9cd9aa2eafe869935d4168031f1ed376d924c (patch)
tree4c4c2028f5f65e0f5df1c0929a087e21eed7db21 /fs/nfs/write.c
parentNFS: Ensure we always dereference the page head last (diff)
downloadkernel-qcow2-linux-7cb9cd9aa2eafe869935d4168031f1ed376d924c.tar.gz
kernel-qcow2-linux-7cb9cd9aa2eafe869935d4168031f1ed376d924c.tar.xz
kernel-qcow2-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/write.c')
-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);
}