diff options
author | Jeff Moyer <jmoyer@redhat.com> | 2015-08-14 16:15:32 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-10-22 14:43:13 -0700 |
commit | eb218995a9031ed04fb5e0566fac5ab21bfe4b4e (patch) | |
tree | 207c4ff733ce94a674d006b450d536ca4a149af6 /fs | |
parent | 7ae7e1459597cbd0c30972f1c29a1b1c0d5825c4 (diff) | |
download | lwn-eb218995a9031ed04fb5e0566fac5ab21bfe4b4e.tar.gz lwn-eb218995a9031ed04fb5e0566fac5ab21bfe4b4e.zip |
blockdev: don't set S_DAX for misaligned partitions
commit f0b2e563bc419df7c1b3d2f494574c25125f6aed upstream.
The dax code doesn't currently support misaligned partitions,
so disable O_DIRECT via dax until such time as that support
materializes.
Suggested-by: Boaz Harrosh <boaz@plexistor.com>
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/block_dev.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c index c7e4163ede87..ccfd31f1df3a 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -1234,6 +1234,13 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part) goto out_clear; } bd_set_size(bdev, (loff_t)bdev->bd_part->nr_sects << 9); + /* + * If the partition is not aligned on a page + * boundary, we can't do dax I/O to it. + */ + if ((bdev->bd_part->start_sect % (PAGE_SIZE / 512)) || + (bdev->bd_part->nr_sects % (PAGE_SIZE / 512))) + bdev->bd_inode->i_flags &= ~S_DAX; } } else { if (bdev->bd_contains == bdev) { |