Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1207891 > unrolled thread
| Started by | Jeff Moyer <jmoyer@redhat.com> |
|---|---|
| First post | 2015-08-14 22:20 +0200 |
| Last post | 2015-08-14 22:30 +0200 |
| Articles | 6 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH 0/2] fix regression in direct I/O to pmem devices Jeff Moyer <jmoyer@redhat.com> - 2015-08-14 22:20 +0200
[PATCH 1/2] dax: fix O_DIRECT I/O to the last block of a blockdev Jeff Moyer <jmoyer@redhat.com> - 2015-08-14 22:20 +0200
Re: [PATCH 1/2] dax: fix O_DIRECT I/O to the last block of a blockdev Linda Knippers <linda.knippers@hp.com> - 2015-08-14 23:00 +0200
Re: [PATCH 0/2] fix regression in direct I/O to pmem devices Dan Williams <dan.j.williams@intel.com> - 2015-08-14 22:30 +0200
Re: [PATCH 0/2] fix regression in direct I/O to pmem devices Dan Williams <dan.j.williams@intel.com> - 2015-08-14 22:30 +0200
Re: [PATCH 0/2] fix regression in direct I/O to pmem devices Jeff Moyer <jmoyer@redhat.com> - 2015-08-14 22:30 +0200
| From | Jeff Moyer <jmoyer@redhat.com> |
|---|---|
| Date | 2015-08-14 22:20 +0200 |
| Subject | [PATCH 0/2] fix regression in direct I/O to pmem devices |
| Message-ID | <pXtCh-48Q-9@gated-at.bofh.it> |
Linda Knippers noticed that commit bbab37ddc20b (block: Add support for DAX reads/writes to block devices) caused a regression in mkfs.xfs. Further investigation also uncovered issues related to misaligned partitions. This patch set addresses the two issues. [PATCH 1/2] dax: fix O_DIRECT I/O to the last block of a blockdev [PATCH 2/2] blockdev: don't set S_DAX for misaligned partitions fs/block_dev.c | 7 +++++++ fs/dax.c | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) -- 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 | Jeff Moyer <jmoyer@redhat.com> |
|---|---|
| Date | 2015-08-14 22:20 +0200 |
| Subject | [PATCH 1/2] dax: fix O_DIRECT I/O to the last block of a blockdev |
| Message-ID | <pXtCi-48Q-37@gated-at.bofh.it> |
| In reply to | #1207891 |
commit bbab37ddc20b (block: Add support for DAX reads/writes to
block devices) caused a regression in mkfs.xfs. That utility
sets the block size of the device to the logical block size
using the BLKBSZSET ioctl, and then issues a single sector read
from the last sector of the device. This results in the dax_io
code trying to do a page-sized read from 512 bytes from the end
of the device. The result is -ERANGE being returned to userspace.
The fix is to align the block to the page size before calling
get_block.
Thanks to willy for simplifying my original patch.
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
---
fs/dax.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/dax.c b/fs/dax.c
index a7f77e1..ef35a20 100644
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -116,7 +116,8 @@ static ssize_t dax_io(struct inode *inode, struct iov_iter *iter,
unsigned len;
if (pos == max) {
unsigned blkbits = inode->i_blkbits;
- sector_t block = pos >> blkbits;
+ long page = pos >> PAGE_SHIFT;
+ sector_t block = page << (PAGE_SHIFT - blkbits);
unsigned first = pos - (block << blkbits);
long size;
--
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] | [prev] | [next] | [standalone]
| From | Linda Knippers <linda.knippers@hp.com> |
|---|---|
| Date | 2015-08-14 23:00 +0200 |
| Subject | Re: [PATCH 1/2] dax: fix O_DIRECT I/O to the last block of a blockdev |
| Message-ID | <pXuf0-4RW-7@gated-at.bofh.it> |
| In reply to | #1207892 |
On 8/14/2015 4:15 PM, Jeff Moyer wrote:
> commit bbab37ddc20b (block: Add support for DAX reads/writes to
> block devices) caused a regression in mkfs.xfs. That utility
> sets the block size of the device to the logical block size
> using the BLKBSZSET ioctl, and then issues a single sector read
> from the last sector of the device. This results in the dax_io
> code trying to do a page-sized read from 512 bytes from the end
> of the device. The result is -ERANGE being returned to userspace.
>
> The fix is to align the block to the page size before calling
> get_block.
>
> Thanks to willy for simplifying my original patch.
>
> Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Tested-by: Linda Knippers <linda.knippers@hp.com>
> ---
> fs/dax.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/dax.c b/fs/dax.c
> index a7f77e1..ef35a20 100644
> --- a/fs/dax.c
> +++ b/fs/dax.c
> @@ -116,7 +116,8 @@ static ssize_t dax_io(struct inode *inode, struct iov_iter *iter,
> unsigned len;
> if (pos == max) {
> unsigned blkbits = inode->i_blkbits;
> - sector_t block = pos >> blkbits;
> + long page = pos >> PAGE_SHIFT;
> + sector_t block = page << (PAGE_SHIFT - blkbits);
> unsigned first = pos - (block << blkbits);
> long size;
>
>
--
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 | Dan Williams <dan.j.williams@intel.com> |
|---|---|
| Date | 2015-08-14 22:30 +0200 |
| Message-ID | <pXtLX-4kb-3@gated-at.bofh.it> |
| In reply to | #1207891 |
On Fri, Aug 14, 2015 at 1:15 PM, Jeff Moyer <jmoyer@redhat.com> wrote: > Linda Knippers noticed that commit bbab37ddc20b (block: Add support > for DAX reads/writes to block devices) caused a regression in mkfs.xfs. > Further investigation also uncovered issues related to misaligned > partitions. This patch set addresses the two issues. > > [PATCH 1/2] dax: fix O_DIRECT I/O to the last block of a blockdev > [PATCH 2/2] blockdev: don't set S_DAX for misaligned partitions Should these be "Cc: <stable@vger.kernel.org>" given the regression fix is applicable back to 4.0? -- 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 | Dan Williams <dan.j.williams@intel.com> |
|---|---|
| Date | 2015-08-14 22:30 +0200 |
| Message-ID | <pXtLX-4kb-9@gated-at.bofh.it> |
| In reply to | #1207894 |
On Fri, Aug 14, 2015 at 1:22 PM, Dan Williams <dan.j.williams@intel.com> wrote: > On Fri, Aug 14, 2015 at 1:15 PM, Jeff Moyer <jmoyer@redhat.com> wrote: >> Linda Knippers noticed that commit bbab37ddc20b (block: Add support >> for DAX reads/writes to block devices) caused a regression in mkfs.xfs. >> Further investigation also uncovered issues related to misaligned >> partitions. This patch set addresses the two issues. >> >> [PATCH 1/2] dax: fix O_DIRECT I/O to the last block of a blockdev >> [PATCH 2/2] blockdev: don't set S_DAX for misaligned partitions > > Should these be "Cc: <stable@vger.kernel.org>" given the regression > fix is applicable back to 4.0? Sorry, regression *since* 4.0. -- 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 22:30 +0200 |
| Message-ID | <pXtLX-4kb-15@gated-at.bofh.it> |
| In reply to | #1207895 |
Dan Williams <dan.j.williams@intel.com> writes: > On Fri, Aug 14, 2015 at 1:22 PM, Dan Williams <dan.j.williams@intel.com> wrote: >> On Fri, Aug 14, 2015 at 1:15 PM, Jeff Moyer <jmoyer@redhat.com> wrote: >>> Linda Knippers noticed that commit bbab37ddc20b (block: Add support >>> for DAX reads/writes to block devices) caused a regression in mkfs.xfs. >>> Further investigation also uncovered issues related to misaligned >>> partitions. This patch set addresses the two issues. >>> >>> [PATCH 1/2] dax: fix O_DIRECT I/O to the last block of a blockdev >>> [PATCH 2/2] blockdev: don't set S_DAX for misaligned partitions >> >> Should these be "Cc: <stable@vger.kernel.org>" given the regression >> fix is applicable back to 4.0? > > Sorry, regression *since* 4.0. $ git describe --contains bbab37ddc20b v4.2-rc1~2^2~4 Looks like this was not sprung on the public yet. -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