summaryrefslogtreecommitdiffstats
path: root/fs/ceph/file.c
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2011-06-07 20:57:14 -0700
committerSage Weil <sage@newdream.net>2011-06-13 16:26:10 -0700
commit773e9b442693b250aa6c452cb0cf5a9343f51cef (patch)
treedbd2d9eacab7272c8ec8ba19a32ea92c559141bf /fs/ceph/file.c
parent0c1f91f27140cf3b6e38dc4e892adac241c73a20 (diff)
downloadop-kernel-dev-773e9b442693b250aa6c452cb0cf5a9343f51cef.zip
op-kernel-dev-773e9b442693b250aa6c452cb0cf5a9343f51cef.tar.gz
ceph: fix page alignment corrections
dd if=/dev/urandom of=/mnt/fs_depot/dd10 bs=500 seek=8388 count=1 dd if=/mnt/fs_depot/dd10 of=/root/dd10out bs=500 skip=8388 count=1 Reported-by: Henry C Chang <henry.cy.chang@gmail.com> Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph/file.c')
-rw-r--r--fs/ceph/file.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index 9542f07..2be0f35 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -290,7 +290,6 @@ static int striped_read(struct inode *inode,
struct ceph_inode_info *ci = ceph_inode(inode);
u64 pos, this_len;
int io_align, page_align;
- int page_off = off & ~PAGE_CACHE_MASK; /* first byte's offset in page */
int left, pages_left;
int read;
struct page **page_pos;
@@ -326,12 +325,11 @@ more:
ret, hit_stripe ? " HITSTRIPE" : "", was_short ? " SHORT" : "");
if (ret > 0) {
- int didpages =
- ((pos & ~PAGE_CACHE_MASK) + ret) >> PAGE_CACHE_SHIFT;
+ int didpages = (page_align + ret) >> PAGE_CACHE_SHIFT;
if (read < pos - off) {
dout(" zero gap %llu to %llu\n", off + read, pos);
- ceph_zero_page_vector_range(page_off + read,
+ ceph_zero_page_vector_range(page_align + read,
pos - off - read, pages);
}
pos += ret;
@@ -356,7 +354,7 @@ more:
left = inode->i_size - pos;
dout("zero tail %d\n", left);
- ceph_zero_page_vector_range(page_off + read, left,
+ ceph_zero_page_vector_range(page_align + read, left,
pages);
read += left;
}
OpenPOWER on IntegriCloud