History

block: disable block device DAX by default

The recent *sync enabling discovered that we are inserting into the block_device pagecache counter to the expectations of the dirty data tracking for dax mappings. This can lead to data corruption. We want to support DAX for block devices eventually, but it requires wider changes to properly manage the pagecache. dump_stack+0x85/0xc2 dax_writeback_mapping_range+0x60/0xe0 blkdev_writepages+0x3f/0x50 do_writepages+0x21/0x30 __filemap_fdatawrite_range+0xc6/0x100 filemap_write_and_wait+0x4a/0xa0 set_blocksize+0x70/0xd0 sb_set_blocksize+0x1d/0x50 ext4_fill_super+0x75b/0x3360 mount_bdev+0x180/0x1b0 ext4_mount+0x15/0x20 mount_fs+0x38/0x170 Mark the support broken so its disabled by default, but otherwise still available for testing.

Dan Williams committed 10 years ago

Commit 03cdadb1 parent a4a84812 files · +18 −1Browse files

Unified · Split

2 files
  1. block/Kconfig +13 −0
  2. fs/block_dev.c +5 −1
block/Kconfig+13−0
@@ -88,6 +88,19 @@ config BLK_DEV_INTEGRITY · 87 unmodified lines
8888 T10/SCSI Data Integrity Field or the T13/ATA External Path
8989 Protection. If in doubt, say N.
9090
91+config BLK_DEV_DAX
92+ bool "Block device DAX support"
93+ depends on FS_DAX
94+ depends on BROKEN
95+ help
96+ When DAX support is available (CONFIG_FS_DAX) raw block
97+ devices can also support direct userspace access to the
98+ storage capacity via MMAP(2) similar to a file on a
99+ DAX-enabled filesystem. However, the DAX I/O-path disables
100+ some standard I/O-statistics, and the MMAP(2) path has some
101+ operational differences due to bypassing the page
102+ cache. If in doubt, say N.
103+
91104 config BLK_DEV_THROTTLING
92105 bool "Block layer bio throttling support"
93106 depends on BLK_CGROUP=y
fs/block_dev.c+5−1
@@ -1201,7 +1201,11 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part) · 1200 unmodified lines
12011201 bdev->bd_disk = disk;
12021202 bdev->bd_queue = disk->queue;
12031203 bdev->bd_contains = bdev;
1204− bdev->bd_inode->i_flags = disk->fops->direct_access ? S_DAX : 0;
1204+ if (IS_ENABLED(CONFIG_BLK_DEV_DAX) && disk->fops->direct_access)
1205+ bdev->bd_inode->i_flags = S_DAX;
1206+ else
1207+ bdev->bd_inode->i_flags = 0;
1208+
12051209 if (!partno) {
12061210 ret = -ENXIO;
12071211 bdev->bd_part = disk_get_part(disk, partno);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t