diff options
author | Yan, Zheng <zheng.z.yan@intel.com> | 2014-07-01 22:13:00 -0400 |
---|---|---|
committer | Ilya Dryomov <ilya.dryomov@inktank.com> | 2014-07-08 07:08:47 -0400 |
commit | 5aaa432ad9ecbfb6587f241747ac1d4a8f10e7e7 (patch) | |
tree | bd4863bda94cbb94f6fb6a271aa991ec669471ed /fs/ceph | |
parent | c5c9a0bf1b03112d606edaab15f18e892e8b55af (diff) |
ceph: pass proper page offset to copy_page_to_iter()
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Diffstat (limited to 'fs/ceph')
-rw-r--r-- | fs/ceph/file.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 19af25dff644..fec9ddcf1528 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c | |||
@@ -470,8 +470,11 @@ static ssize_t ceph_sync_read(struct kiocb *iocb, struct iov_iter *i, | |||
470 | size_t left = ret; | 470 | size_t left = ret; |
471 | 471 | ||
472 | while (left) { | 472 | while (left) { |
473 | int copy = min_t(size_t, PAGE_SIZE, left); | 473 | size_t page_off = off & ~PAGE_MASK; |
474 | l = copy_page_to_iter(pages[k++], 0, copy, i); | 474 | size_t copy = min_t(size_t, |
475 | PAGE_SIZE - page_off, left); | ||
476 | l = copy_page_to_iter(pages[k++], page_off, | ||
477 | copy, i); | ||
475 | off += l; | 478 | off += l; |
476 | left -= l; | 479 | left -= l; |
477 | if (l < copy) | 480 | if (l < copy) |