@@ -1673,7 +1673,8 @@ int ltfs_mount(bool force_full, bool deep_recovery, bool recover_extra, bool rec
1673
1673
(unsigned long long )vol -> dp_coh .volume_change_ref ,
1674
1674
(unsigned long long )volume_change_ref );
1675
1675
1676
- ret = _ltfs_search_index_wp (recover_symlink , false, & seekpos , vol );
1676
+ /* Index of IP could be corrupted. So set skip flag to true */
1677
+ ret = _ltfs_search_index_wp (recover_symlink , true, & seekpos , vol );
1677
1678
if (ret < 0 )
1678
1679
goto out_unlock ;
1679
1680
@@ -1683,7 +1684,7 @@ int ltfs_mount(bool force_full, bool deep_recovery, bool recover_extra, bool rec
1683
1684
seekpos .block = vol -> dp_coh .set_id ;
1684
1685
}
1685
1686
} else {
1686
- if (vollock != PWE_MAM_DP && vollock != PWE_MAM ) {
1687
+ if (vol -> ip_coh . count > vol -> dp_coh . count && vollock != PWE_MAM_DP && vollock != PWE_MAM ) {
1687
1688
/*
1688
1689
* The index on IP is newer but MAM shows write perm doesn't happen in DP.
1689
1690
* LTFS already have written an index on DP when it is writing an index on IP,
@@ -1702,8 +1703,13 @@ int ltfs_mount(bool force_full, bool deep_recovery, bool recover_extra, bool rec
1702
1703
(unsigned long long )vol -> dp_coh .volume_change_ref ,
1703
1704
(unsigned long long )volume_change_ref );
1704
1705
1705
- /* Index of IP could be corrupted. So set skip flag */
1706
- ret = _ltfs_search_index_wp (recover_symlink , true, & seekpos , vol );
1706
+ if (vollock == PWE_MAM_BOTH ) {
1707
+ /* Index of IP could be corrupted (because of double write perm). So set skip flag to true */
1708
+ ret = _ltfs_search_index_wp (recover_symlink , true, & seekpos , vol );
1709
+ } else {
1710
+ /* Index of DP could be corrupted. So set skip flag to false */
1711
+ ret = _ltfs_search_index_wp (recover_symlink , false, & seekpos , vol );
1712
+ }
1707
1713
if (ret < 0 )
1708
1714
goto out_unlock ;
1709
1715
0 commit comments