[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <A631E1AA-B8E5-43EF-8EF6-76E056F46429@dilger.ca>
Date: Fri, 14 Aug 2015 14:46:04 -0600
From: Andreas Dilger <adilger@...ger.ca>
To: Jeff Moyer <jmoyer@...hat.com>
Cc: matthew.r.wilcox@...el.com, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-nvdimm@...1.01.org
Subject: Re: [PATCH 2/2] blockdev: don't set S_DAX for misaligned partitions
On Aug 14, 2015, at 2:15 PM, Jeff Moyer <jmoyer@...hat.com> wrote:
>
> 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@...xistor.com>
> Signed-off-by: Jeff Moyer <jmoyer@...hat.com>
> ---
> fs/block_dev.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/fs/block_dev.c b/fs/block_dev.c
> index 1982437..1170f8c 100644
> --- a/fs/block_dev.c
> +++ b/fs/block_dev.c
> @@ -1241,6 +1241,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)))
Maybe I'm missing something, but doesn't the second condition above
disable DAX for the case that the 1/2 patch is fixing (i.e. the last
sectors at the end of a non-PAGE_SIZE-multiple device)? It seems a
shame to disable DAX for the whole device because of the last sector.
> + bdev->bd_inode->i_flags &= ~S_DAX;
> }
> } else {
> if (bdev->bd_contains == bdev) {
> --
> 1.8.3.1
Cheers, Andreas
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists