[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] xenpaging: make file_op largefile aware
# HG changeset patch # User Olaf Hering <olaf@xxxxxxxxx> # Date 1327691017 0 # Node ID 255ae011567db6b96b083347158c28e30b656970 # Parent cdb1e4a3845024c474141e6962ca0a8ace062d55 xenpaging: make file_op largefile aware lseek() takes an off_t, the used "int << shiftsize" does not automatically convert the int into a larger type. This leads to write errors with pagefiles larger than 2G. Fix this by shifting an off_t instead of an int. Signed-off-by: Olaf Hering <olaf@xxxxxxxxx> Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx> --- diff -r cdb1e4a38450 -r 255ae011567d tools/xenpaging/file_ops.c --- a/tools/xenpaging/file_ops.c Fri Jan 27 18:32:55 2012 +0000 +++ b/tools/xenpaging/file_ops.c Fri Jan 27 19:03:37 2012 +0000 @@ -26,12 +26,12 @@ static int file_op(int fd, void *page, int i, ssize_t (*fn)(int, void *, size_t)) { - off_t seek_ret; + off_t offset = i; int total = 0; int bytes; - seek_ret = lseek(fd, i << PAGE_SHIFT, SEEK_SET); - if ( seek_ret == (off_t)-1 ) + offset = lseek(fd, offset << PAGE_SHIFT, SEEK_SET); + if ( offset == (off_t)-1 ) return -1; while ( total < PAGE_SIZE ) _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |