File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -1404,8 +1404,9 @@ int do_write_data_page(struct f2fs_io_info *fio)
1404
1404
}
1405
1405
}
1406
1406
1407
- if (fio -> need_lock == LOCK_REQ )
1408
- f2fs_lock_op (fio -> sbi );
1407
+ /* Deadlock due to between page->lock and f2fs_lock_op */
1408
+ if (fio -> need_lock == LOCK_REQ && !f2fs_trylock_op (fio -> sbi ))
1409
+ return - EAGAIN ;
1409
1410
1410
1411
err = get_dnode_of_data (& dn , page -> index , LOOKUP_NODE );
1411
1412
if (err )
@@ -1667,7 +1668,7 @@ static int f2fs_write_cache_pages(struct address_space *mapping,
1667
1668
}
1668
1669
1669
1670
done_index = page -> index ;
1670
-
1671
+ retry_write :
1671
1672
lock_page (page );
1672
1673
1673
1674
if (unlikely (page -> mapping != mapping )) {
@@ -1703,6 +1704,15 @@ static int f2fs_write_cache_pages(struct address_space *mapping,
1703
1704
unlock_page (page );
1704
1705
ret = 0 ;
1705
1706
continue ;
1707
+ } else if (ret == - EAGAIN ) {
1708
+ ret = 0 ;
1709
+ if (wbc -> sync_mode == WB_SYNC_ALL ) {
1710
+ cond_resched ();
1711
+ congestion_wait (BLK_RW_ASYNC ,
1712
+ HZ /50 );
1713
+ goto retry_write ;
1714
+ }
1715
+ continue ;
1706
1716
}
1707
1717
done_index = page -> index + 1 ;
1708
1718
done = 1 ;
You can’t perform that action at this time.
0 commit comments