]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - fs/ceph/file.c
ceph: fix copy_user_to_page_vector()
[net-next-2.6.git] / 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;