Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1202122
| From | Jeff Moyer <jmoyer@redhat.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: regression introduced by "block: Add support for DAX reads/writes to block devices" |
| Date | 2015-08-07 00:30 +0200 |
| Message-ID | <pUBPH-5As-5@gated-at.bofh.it> (permalink) |
| References | <pUdkp-3qW-71@gated-at.bofh.it> <pUulb-367-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
"Wilcox, Matthew R" <matthew.r.wilcox@intel.com> writes:
> I think I see the problem. I'm kind of wrapped up in other things
> right now; can you try replacing the line in dax_io():
>
> - bh->b_size = PAGE_ALIGN(end - pos);
> + bh->b_size = ALIGN(end - pos, 1 << blkbits);
This works for me. If it looks okay to others, I'll submit a properly
signed-off patch.
Cheers,
Jeff
diff --git a/fs/dax.c b/fs/dax.c
index a7f77e1..b6c4f93 100644
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -98,6 +98,10 @@ static bool buffer_size_valid(struct buffer_head *bh)
return bh->b_state != 0;
}
+/*
+ * This function assumes file system block size (represented by
+ * inode->i_blkbits) is less than or equal to the system page size.
+ */
static ssize_t dax_io(struct inode *inode, struct iov_iter *iter,
loff_t start, loff_t end, get_block_t get_block,
struct buffer_head *bh)
@@ -117,9 +121,15 @@ static ssize_t dax_io(struct inode *inode, struct iov_iter *iter,
if (pos == max) {
unsigned blkbits = inode->i_blkbits;
sector_t block = pos >> blkbits;
- unsigned first = pos - (block << blkbits);
+ long page = pos >> PAGE_SHIFT;
+ unsigned first; /* byte offset into block */
long size;
+ /* we can only map entire pages */
+ if (pos & (PAGE_SIZE-1))
+ block = page << (PAGE_SHIFT - blkbits);
+ first = pos - (block << blkbits);
+
if (pos == bh_max) {
bh->b_size = PAGE_ALIGN(end - pos);
bh->b_state = 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/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
regression introduced by "block: Add support for DAX reads/writes to block devices" Jeff Moyer <jmoyer@redhat.com> - 2015-08-05 22:20 +0200
Re: regression introduced by "block: Add support for DAX reads/writes to block devices" Dave Chinner <david@fromorbit.com> - 2015-08-06 00:10 +0200
Re: regression introduced by "block: Add support for DAX reads/writes to block devices" Linda Knippers <linda.knippers@hp.com> - 2015-08-06 03:50 +0200
Re: regression introduced by "block: Add support for DAX reads/writes to block devices" Dave Chinner <david@fromorbit.com> - 2015-08-06 05:30 +0200
Re: regression introduced by "block: Add support for DAX reads/writes to block devices" Boaz Harrosh <boaz@plexistor.com> - 2015-08-06 10:00 +0200
Re: regression introduced by "block: Add support for DAX reads/writes to block devices" Dave Chinner <david@fromorbit.com> - 2015-08-06 22:40 +0200
Re: regression introduced by "block: Add support for DAX reads/writes to block devices" Boaz Harrosh <boaz@plexistor.com> - 2015-08-09 11:00 +0200
Re: regression introduced by "block: Add support for DAX reads/writes to block devices" Linda Knippers <linda.knippers@hp.com> - 2015-08-10 18:40 +0200
Re: regression introduced by "block: Add support for DAX reads/writes to block devices" Dave Chinner <david@fromorbit.com> - 2015-08-10 23:30 +0200
Re: regression introduced by "block: Add support for DAX reads/writes to block devices" Linda Knippers <linda.knippers@hp.com> - 2015-08-11 01:10 +0200
RE: regression introduced by "block: Add support for DAX reads/writes to block devices" "Wilcox, Matthew R" <matthew.r.wilcox@intel.com> - 2015-08-06 16:30 +0200
Re: regression introduced by "block: Add support for DAX reads/writes to block devices" Jeff Moyer <jmoyer@redhat.com> - 2015-08-06 17:40 +0200
RE: regression introduced by "block: Add support for DAX reads/writes to block devices" "Wilcox, Matthew R" <matthew.r.wilcox@intel.com> - 2015-08-06 18:00 +0200
Re: regression introduced by "block: Add support for DAX reads/writes to block devices" Jeff Moyer <jmoyer@redhat.com> - 2015-08-07 00:30 +0200
RE: regression introduced by "block: Add support for DAX reads/writes to block devices" "Wilcox, Matthew R" <matthew.r.wilcox@intel.com> - 2015-08-07 20:20 +0200
Re: regression introduced by "block: Add support for DAX reads/writes to block devices" Jeff Moyer <jmoyer@redhat.com> - 2015-08-07 22:50 +0200
Re: regression introduced by "block: Add support for DAX reads/writes to block devices" Boaz Harrosh <boaz@plexistor.com> - 2015-08-10 09:50 +0200
Re: regression introduced by "block: Add support for DAX reads/writes to block devices" Jeff Moyer <jmoyer@redhat.com> - 2015-08-12 23:20 +0200
Re: regression introduced by "block: Add support for DAX reads/writes to block devices" Boaz Harrosh <boaz@plexistor.com> - 2015-08-13 07:40 +0200
Re: regression introduced by "block: Add support for DAX reads/writes to block devices" Jeff Moyer <jmoyer@redhat.com> - 2015-08-13 16:10 +0200
Re: regression introduced by "block: Add support for DAX reads/writes to block devices" Linda Knippers <linda.knippers@hp.com> - 2015-08-13 18:50 +0200
Re: regression introduced by "block: Add support for DAX reads/writes to block devices" Jeff Moyer <jmoyer@redhat.com> - 2015-08-13 19:20 +0200
Re: regression introduced by "block: Add support for DAX reads/writes to block devices" Linda Knippers <linda.knippers@hp.com> - 2015-08-13 20:00 +0200
Re: regression introduced by "block: Add support for DAX reads/writes to block devices" Jeff Moyer <jmoyer@redhat.com> - 2015-08-13 20:20 +0200
RE: regression introduced by "block: Add support for DAX reads/writes to block devices" "Wilcox, Matthew R" <matthew.r.wilcox@intel.com> - 2015-08-13 21:40 +0200
Re: regression introduced by "block: Add support for DAX reads/writes to block devices" Dan Williams <dan.j.williams@intel.com> - 2015-08-14 18:30 +0200
csiph-web