Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1207890 > unrolled thread
| Started by | Jeff Moyer <jmoyer@redhat.com> |
|---|---|
| First post | 2015-08-14 22:20 +0200 |
| Last post | 2015-08-14 23:00 +0200 |
| Articles | 3 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH 2/2] blockdev: don't set S_DAX for misaligned partitions Jeff Moyer <jmoyer@redhat.com> - 2015-08-14 22:20 +0200
Re: [PATCH 2/2] blockdev: don't set S_DAX for misaligned partitions Andreas Dilger <adilger@dilger.ca> - 2015-08-14 22:50 +0200
Re: [PATCH 2/2] blockdev: don't set S_DAX for misaligned partitions Jeff Moyer <jmoyer@redhat.com> - 2015-08-14 23:00 +0200
| From | Jeff Moyer <jmoyer@redhat.com> |
|---|---|
| Date | 2015-08-14 22:20 +0200 |
| Subject | [PATCH 2/2] blockdev: don't set S_DAX for misaligned partitions |
| Message-ID | <pXtCh-48Q-7@gated-at.bofh.it> |
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>
---
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)))
+ bdev->bd_inode->i_flags &= ~S_DAX;
}
} else {
if (bdev->bd_contains == bdev) {
--
1.8.3.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Andreas Dilger <adilger@dilger.ca> |
|---|---|
| Date | 2015-08-14 22:50 +0200 |
| Message-ID | <pXu5j-4GE-1@gated-at.bofh.it> |
| In reply to | #1207890 |
On Aug 14, 2015, at 2:15 PM, Jeff Moyer <jmoyer@redhat.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@plexistor.com>
> Signed-off-by: Jeff Moyer <jmoyer@redhat.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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Jeff Moyer <jmoyer@redhat.com> |
|---|---|
| Date | 2015-08-14 23:00 +0200 |
| Message-ID | <pXueZ-4RW-1@gated-at.bofh.it> |
| In reply to | #1207898 |
Andreas Dilger <adilger@dilger.ca> writes: > On Aug 14, 2015, at 2:15 PM, Jeff Moyer <jmoyer@redhat.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@plexistor.com> >> Signed-off-by: Jeff Moyer <jmoyer@redhat.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. No. Patch 1/2 fixes a 512 byte read of the last sector of a properly aligned partiton. The goal is to eventually fix things so we can enable the dax path for misaligned partitions, but it's not going to happen in time for 4.2. Also, keep in mind that this is just for opening the block device itself with O_DIRECT. Thanks for taking a look. Cheers, Jeff -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web