From: Trond Myklebust Date: Mon, 17 Jul 2017 14:11:11 +0000 (-0400) Subject: NFS: Fix a reference and lock leak in nfs_lock_and_join_requests() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=7cb9cd9aa2eafe869935d4168031f1ed376d924c;p=openwrt%2Fstaging%2Fblogic.git 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 --- 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); }