@@ -404,8 +404,6 @@ nfs_destroy_unlinked_subrequests(struct nfs_page *destroy_list,
404404 subreq -> wb_head = subreq ;
405405 subreq -> wb_this_page = subreq ;
406406
407- nfs_clear_request_commit (subreq );
408-
409407 /* subreq is now totally disconnected from page group or any
410408 * write / commit lists. last chance to wake any waiters */
411409 nfs_unlock_request (subreq );
@@ -515,7 +513,7 @@ nfs_lock_and_join_requests(struct page *page, bool nonblock)
515513 * Commit list removal accounting is done after locks are dropped */
516514 subreq = head ;
517515 do {
518- nfs_list_remove_request (subreq );
516+ nfs_clear_request_commit (subreq );
519517 subreq = subreq -> wb_this_page ;
520518 } while (subreq != head );
521519
@@ -545,15 +543,11 @@ nfs_lock_and_join_requests(struct page *page, bool nonblock)
545543
546544 nfs_page_group_unlock (head );
547545
548- /* drop lock to clear_request_commit the head req and clean up
549- * requests on destroy list */
546+ /* drop lock to clean uprequests on destroy list */
550547 spin_unlock (& inode -> i_lock );
551548
552549 nfs_destroy_unlinked_subrequests (destroy_list , head );
553550
554- /* clean up commit list state */
555- nfs_clear_request_commit (head );
556-
557551 /* still holds ref on head from nfs_page_find_head_request_locked
558552 * and still has lock on head from lock loop */
559553 return head ;
@@ -837,6 +831,7 @@ nfs_clear_page_commit(struct page *page)
837831 dec_bdi_stat (page_file_mapping (page )-> backing_dev_info , BDI_RECLAIMABLE );
838832}
839833
834+ /* Called holding inode (/cinfo) lock */
840835static void
841836nfs_clear_request_commit (struct nfs_page * req )
842837{
@@ -846,9 +841,7 @@ nfs_clear_request_commit(struct nfs_page *req)
846841
847842 nfs_init_cinfo_from_inode (& cinfo , inode );
848843 if (!pnfs_clear_request_commit (req , & cinfo )) {
849- spin_lock (cinfo .lock );
850844 nfs_request_remove_commit_list (req , & cinfo );
851- spin_unlock (cinfo .lock );
852845 }
853846 nfs_clear_page_commit (req -> wb_page );
854847 }
@@ -1061,9 +1054,9 @@ static struct nfs_page *nfs_try_to_update_request(struct inode *inode,
10611054 else
10621055 req -> wb_bytes = rqend - req -> wb_offset ;
10631056out_unlock :
1064- spin_unlock (& inode -> i_lock );
10651057 if (req )
10661058 nfs_clear_request_commit (req );
1059+ spin_unlock (& inode -> i_lock );
10671060 return req ;
10681061out_flushme :
10691062 spin_unlock (& inode -> i_lock );
0 commit comments