ext4: fix DAX dma vs truncate/hole-punch
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v4 Latest2 patches 21 repliesIn review
- v22 patches 9 repliesApplied
- v12 patches 4 repliesSuperseded
Changes in v4 from the cover letter
* Added an ext4_break_layouts() call to ext4_insert_range() to ensure that the {ext4,xfs}_break_layouts() calls have the same meaning. (Dave, Darrick and Jan)
Patches in v4 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | dax: dax_layout_busy_page() warn on !exceptionalfs/ | +9 | 7 replies | |
| 2/2 | ext4: handle layout changes to pinned DAX mappingsfs/ fs/ fs/ +1 more | +68 | 0 replies |
Reviews trailers per patch
All 2 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Jan Kara | Lukas Czerner |
|---|---|---|
| Series | R-b | |
| 1/2 | R-b | |
| 2/2 | R-b | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v4 0/2] ext4: fix DAX dma vs truncate/hole-punch
Changes since v3:
* Added an ext4_break_layouts() call to ext4_insert_range() to ensure that the {ext4,xfs}_break_layouts() calls have the same meaning. (Dave, Darrick and Jan)
---
This series from Dan:
https://lists.01.org/pipermail/linux-nvdimm/2018-March/014913.html
added synchronization between DAX dma and truncate/hole-punch in XFS. This short series adds analogous support to ext4.
I've added calls to ext4_break_layouts() everywhere that ext4 removes blocks from an inode's map.
The timings in XFS are such that it's difficult to hit this race. Dan was able to show the race by manually introducing delays in the direct I/O path.
For ext4, though, its trivial to hit this race, and a hit will result in a trigger of this WARN_ON_ONCE() in dax_disassociate_entry():
WARN_ON_ONCE(trunc && page_ref_count(page) > 1);
I've made an xfstest which tests all the paths where we now call ext4_break_layouts(). Each of the four paths easily hits this race many times in my test setup with the xfstest. You can find that test here:
https://lists.01.org/pipermail/linux-nvdimm/2018-June/016435.html
With these patches applied, I've still seen occasional hits of the above WARN_ON_ONCE(), which tells me that we still have some work to do. I'll continue looking at these more rare hits.
Ross Zwisler (2):
dax: dax_layout_busy_page() warn on !exceptional
ext4: handle layout changes to pinned DAX mappings
fs/dax.c | 10 +++++++++- fs/ext4/ext4.h | 1 + fs/ext4/extents.c | 17 +++++++++++++++++ fs/ext4/inode.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ fs/ext4/truncate.h | 4 ++++ 5 files changed, 77 insertions(+), 1 deletion(-)
Signature · 1 line
2.14.4