提交 a77d9f7d 编写于 作者: S Sage Weil

ceph: fix file offset wrapping at 4GB on 32-bit archs

Cast the value before shifting so that we don't run out of bits with a
32-bit unsigned long.  This fixes wrapping of high file offsets into the
low 4GB of a file on disk, and the subsequent data corruption for large
files.
Signed-off-by: NSage Weil <sage@newdream.net>
上级 3612abbd
......@@ -766,7 +766,8 @@ static int ceph_writepages_start(struct address_space *mapping,
/* ok */
if (locked_pages == 0) {
/* prepare async write request */
offset = page->index << PAGE_CACHE_SHIFT;
offset = (unsigned long long)page->index
<< PAGE_CACHE_SHIFT;
len = wsize;
req = ceph_osdc_new_request(&client->osdc,
&ci->i_layout,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册