Skip to content

DAX fixes, move flushing calls to FS

Ross Zwisler linux-ext4 linux-fsdevel linux-mm linux-nvdimm linux-xfs lkml nvdimm 4 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest5 patches 0 repliesNew
  2. v36 patches 9 repliesSuperseded
  3. v22 patches 17 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v12 patches21 repliesSuperseded

Changes in v4 from the cover letter

- Added Reviewed-by tags from Jan Kara.
- Dropped patch 6, "block: use dax_do_io() if blkdev_dax_capable()"

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5block: disable block device DAX by defaultblock/Kconfig fs/block_dev.c+18 -10 replies
2/5ext2, ext4: only set S_DAX for regular inodesfs/ext2/inode.c fs/ext4/inode.c+2 -20 replies
3/5ext4: Online defrag not supported with DAXfs/ext4/ioctl.c+5 -00 replies
4/5dax: give DAX clearing code correct bdevfs/dax.c fs/ext2/inode.c fs/xfs/xfs_aops.c +3 more+13 -100 replies
5/5dax: move writeback calls into the filesystemsfs/block_dev.c fs/dax.c fs/ext2/inode.c +4 more+43 -160 replies

Reviews trailers per patch

4 of 5 patches have a Reviewed-by or Acked-by.

PatchJan Kara
1/5R-b
2/5R-b
3/5R-b
4/5R-b
5/5

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/5] DAX fixes, move flushing calls to FS

Changes since v3:
- Added Reviewed-by tags from Jan Kara.
- Dropped patch 6, "block: use dax_do_io() if blkdev_dax_capable()"

I believe that this series is ready for inclusion in v4.5. I think it should be merged for v4.5 because it fixes serious issues with the DAX code including possible data corruption and kernel OOPSes.

akpm, for the v4.5 merge do you want these patches to go through the -mm tree, or would it be better if I just sent them to Linus directly?

A working tree can be found here:
https://git.kernel.org/cgit/linux/kernel/git/zwisler/linux.git/log/?h=fsync_bdev_v4

---
Previous summary with issue impacts added:

This patch series fixes several issues with the current DAX code:

1) DAX is used by default on raw block devices that are capable of supporting it. This creates an issue because there are still uses of the block device that use the page cache, and having one block device user doing DAX I/O and another doing page cache I/O can lead to data corruption.

2) When S_DAX is set on an inode we assume that if there are pages attached to the mapping (mapping->nrpages != 0), those pages are clean zero pages that were used to service reads from holes. This wasn't true in all cases.

3) ext4 online defrag combined with DAX I/O could lead to data corruption.

4) The DAX block/sector zeroing code needs a valid struct block_device, which it wasn't always getting. This could lead to a kernel OOPS.

5) The DAX writeback code needs a valid struct block_device, which it wasn't always getting. This could lead to a kernel OOPS.

6) The DAX writeback code needs to be called for sync(2) and syncfs(2). This could lead to data loss.

Dan Williams (1):
block: disable block device DAX by default

Ross Zwisler (4):
ext2, ext4: only set S_DAX for regular inodes
ext4: Online defrag not supported with DAX
dax: give DAX clearing code correct bdev
dax: move writeback calls into the filesystems

 block/Kconfig          | 13 +++++++++++++
 fs/block_dev.c         | 19 +++++++++++++++++--
 fs/dax.c               | 21 +++++++++++----------
 fs/ext2/inode.c        | 16 +++++++++++++---
 fs/ext4/inode.c        |  6 +++++-
 fs/ext4/ioctl.c        |  5 +++++
 fs/xfs/xfs_aops.c      |  6 +++++-
 fs/xfs/xfs_aops.h      |  1 +
 fs/xfs/xfs_bmap_util.c |  3 ++-
 include/linux/dax.h    |  8 +++++---
 mm/filemap.c           | 12 ++++--------
 11 files changed, 81 insertions(+), 29 deletions(-)
Signature · 7 lines
2.5.0

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>