ceph: fix copy_user_to_page_vector()
authorYehuda Sadeh <yehuda@hq.newdream.net>
Thu, 31 Dec 2009 20:04:58 +0000 (12:04 -0800)
committerSage Weil <sage@newdream.net>
Thu, 7 Jan 2010 00:05:20 +0000 (16:05 -0800)
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 <yehuda@hq.newdream.net>
Signed-off-by: Sage Weil <sage@newdream.net>
fs/ceph/file.c

index fc8aff4767d3fc8d46a4d70ca52cf59e0866ac58..2d88c805a56c430412bfd8b8b44f01284926fdf2 100644 (file)
@@ -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;