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>
This commit is contained in:
@ -526,8 +526,7 @@ try_again:
|
|||||||
} else if (WARN_ON_ONCE(subreq->wb_offset < head->wb_offset ||
|
} else if (WARN_ON_ONCE(subreq->wb_offset < head->wb_offset ||
|
||||||
((subreq->wb_offset + subreq->wb_bytes) >
|
((subreq->wb_offset + subreq->wb_bytes) >
|
||||||
(head->wb_offset + total_bytes)))) {
|
(head->wb_offset + total_bytes)))) {
|
||||||
nfs_page_group_unlock(head);
|
nfs_unroll_locks_and_wait(inode, head, subreq);
|
||||||
spin_unlock(&inode->i_lock);
|
|
||||||
return ERR_PTR(-EIO);
|
return ERR_PTR(-EIO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user