Skip to content

Commit 8e5419d

Browse files
Dan CarpenterTrond Myklebust
authored andcommitted
nfs: Add missing release on error in nfs_lock_and_join_requests()
Call nfs_release_request() on this error path before returning. Fixes: c3f2235 ("nfs: fold nfs_folio_find_and_lock_request into nfs_lock_and_join_requests") Signed-off-by: Dan Carpenter <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Trond Myklebust <[email protected]>
1 parent 9e8f324 commit 8e5419d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fs/nfs/write.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,8 +579,10 @@ static struct nfs_page *nfs_lock_and_join_requests(struct folio *folio)
579579

580580
while (!nfs_lock_request(head)) {
581581
ret = nfs_wait_on_request(head);
582-
if (ret < 0)
582+
if (ret < 0) {
583+
nfs_release_request(head);
583584
return ERR_PTR(ret);
585+
}
584586
}
585587

586588
/* Ensure that nobody removed the request before we locked it */

0 commit comments

Comments
 (0)