From: Yehuda Sadeh Date: Thu, 31 Dec 2009 20:04:58 +0000 (-0800) Subject: ceph: fix copy_user_to_page_vector() X-Git-Tag: v2.6.34-rc2~9^2~72 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=6a4ef48103a78a46b80e07fcd8ac4edda0c7128f;p=linux.git ceph: fix copy_user_to_page_vector() The function was broken in the case where there was more than one page involved, broke the ceph sync_write case. Signed-off-by: Yehuda Sadeh Signed-off-by: Sage Weil --- diff --git a/fs/ceph/file.c b/fs/ceph/file.c index fc8aff4767d3..2d88c805a56c 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c @@ -350,10 +350,10 @@ static int copy_user_to_page_vector(struct page **pages, return -EFAULT; data += l - bad; left -= l - bad; - if (po) { - po += l - bad; - if (po == PAGE_CACHE_SIZE) - po = 0; + po += l - bad; + if (po == PAGE_CACHE_SIZE) { + po = 0; + i++; } } return len;