From: Yan, Zheng Date: Wed, 2 Jul 2014 02:13:00 +0000 (+0800) Subject: ceph: pass proper page offset to copy_page_to_iter() X-Git-Tag: v3.17-rc1~42^2~21 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=5aaa432ad9ecbfb6587f241747ac1d4a8f10e7e7;p=karo-tx-linux.git ceph: pass proper page offset to copy_page_to_iter() Signed-off-by: Yan, Zheng --- 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, size_t left = ret; while (left) { - int copy = min_t(size_t, PAGE_SIZE, left); - l = copy_page_to_iter(pages[k++], 0, copy, i); + size_t page_off = off & ~PAGE_MASK; + size_t copy = min_t(size_t, + PAGE_SIZE - page_off, left); + l = copy_page_to_iter(pages[k++], page_off, + copy, i); off += l; left -= l; if (l < copy)