diff options
Diffstat (limited to 'fs/dax.c')
-rw-r--r-- | fs/dax.c | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -859,6 +859,7 @@ int dax_writeback_mapping_range(struct address_space *mapping, | |||
859 | if (ret < 0) | 859 | if (ret < 0) |
860 | goto out; | 860 | goto out; |
861 | } | 861 | } |
862 | start_index = indices[pvec.nr - 1] + 1; | ||
862 | } | 863 | } |
863 | out: | 864 | out: |
864 | put_dax(dax_dev); | 865 | put_dax(dax_dev); |
@@ -1155,6 +1156,17 @@ static int dax_iomap_pte_fault(struct vm_fault *vmf, | |||
1155 | } | 1156 | } |
1156 | 1157 | ||
1157 | /* | 1158 | /* |
1159 | * It is possible, particularly with mixed reads & writes to private | ||
1160 | * mappings, that we have raced with a PMD fault that overlaps with | ||
1161 | * the PTE we need to set up. If so just return and the fault will be | ||
1162 | * retried. | ||
1163 | */ | ||
1164 | if (pmd_trans_huge(*vmf->pmd) || pmd_devmap(*vmf->pmd)) { | ||
1165 | vmf_ret = VM_FAULT_NOPAGE; | ||
1166 | goto unlock_entry; | ||
1167 | } | ||
1168 | |||
1169 | /* | ||
1158 | * Note that we don't bother to use iomap_apply here: DAX required | 1170 | * Note that we don't bother to use iomap_apply here: DAX required |
1159 | * the file system block size to be equal the page size, which means | 1171 | * the file system block size to be equal the page size, which means |
1160 | * that we never have to deal with more than a single extent here. | 1172 | * that we never have to deal with more than a single extent here. |
@@ -1398,6 +1410,18 @@ static int dax_iomap_pmd_fault(struct vm_fault *vmf, | |||
1398 | goto fallback; | 1410 | goto fallback; |
1399 | 1411 | ||
1400 | /* | 1412 | /* |
1413 | * It is possible, particularly with mixed reads & writes to private | ||
1414 | * mappings, that we have raced with a PTE fault that overlaps with | ||
1415 | * the PMD we need to set up. If so just return and the fault will be | ||
1416 | * retried. | ||
1417 | */ | ||
1418 | if (!pmd_none(*vmf->pmd) && !pmd_trans_huge(*vmf->pmd) && | ||
1419 | !pmd_devmap(*vmf->pmd)) { | ||
1420 | result = 0; | ||
1421 | goto unlock_entry; | ||
1422 | } | ||
1423 | |||
1424 | /* | ||
1401 | * Note that we don't use iomap_apply here. We aren't doing I/O, only | 1425 | * Note that we don't use iomap_apply here. We aren't doing I/O, only |
1402 | * setting up a mapping, so really we're using iomap_begin() as a way | 1426 | * setting up a mapping, so really we're using iomap_begin() as a way |
1403 | * to look up our filesystem block. | 1427 | * to look up our filesystem block. |