diff options
author | Sage Weil <sage@newdream.net> | 2010-09-11 13:55:25 -0400 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2010-09-11 13:55:25 -0400 |
commit | a77d9f7dce7600058d56f0670ed29d77abffcde2 (patch) | |
tree | 60c0b90d2f3af86e9d65641f61ceca075ed61fdf | |
parent | 3612abbd5df6baa9ca3e0777c6c8646e202d3f66 (diff) |
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: Sage Weil <sage@newdream.net>
-rw-r--r-- | fs/ceph/addr.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index 4cfce1ee31f..50461b8c23a 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c | |||
@@ -766,7 +766,8 @@ get_more_pages: | |||
766 | /* ok */ | 766 | /* ok */ |
767 | if (locked_pages == 0) { | 767 | if (locked_pages == 0) { |
768 | /* prepare async write request */ | 768 | /* prepare async write request */ |
769 | offset = page->index << PAGE_CACHE_SHIFT; | 769 | offset = (unsigned long long)page->index |
770 | << PAGE_CACHE_SHIFT; | ||
770 | len = wsize; | 771 | len = wsize; |
771 | req = ceph_osdc_new_request(&client->osdc, | 772 | req = ceph_osdc_new_request(&client->osdc, |
772 | &ci->i_layout, | 773 | &ci->i_layout, |