Skip to content

Commit 8b77484

Browse files
committed
NFS: Don't hold the group lock when calling nfs_release_request()
That can deadlock if this is the last reference since nfs_page_group_destroy() calls nfs_page_group_sync_on_bit(). Note that even if the page was removed from the subpage list, the req->wb_head could still be pointing to the old head. Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
1 parent 5d2a9d9 commit 8b77484

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/nfs/write.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,9 +532,9 @@ nfs_lock_and_join_requests(struct page *page)
532532
} else if (WARN_ON_ONCE(subreq->wb_offset < head->wb_offset ||
533533
((subreq->wb_offset + subreq->wb_bytes) >
534534
(head->wb_offset + total_bytes)))) {
535+
nfs_page_group_unlock(head);
535536
nfs_unroll_locks(inode, head, subreq);
536537
nfs_unlock_and_release_request(subreq);
537-
nfs_page_group_unlock(head);
538538
nfs_unlock_and_release_request(head);
539539
return ERR_PTR(-EIO);
540540
}

0 commit comments

Comments
 (0)