浏览代码

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 <yehuda@hq.newdream.net>
Signed-off-by: Sage Weil <sage@newdream.net>
Yehuda Sadeh 15 年之前
父节点
当前提交
6a4ef48103
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      fs/ceph/file.c

+ 4 - 4
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;