Skip to contentSkip to conversation

UML - Use 64-bits for block size on x86_64

PATCH In review Jeff Dike 1 participant 1 message Aug 18, 2007 User-mode Linux (UML)

lore
Share & tools
lore

Jeff Dike

author
#0 lore raw

PATCH 2/6 UML - Use 64-bits for block size on x86_64

The BLKGETSIZE ioctl expects a pointer to a long, os_file_size was providing an int. Therefore, ubd access to host block devices caused a segmentation fault on 64 bits systems.

--

 arch/um/os-Linux/file.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/um/os-Linux/file.c +2 -1
Index: linux-2.6.22/arch/um/os-Linux/file.c
===================================================================
@@ -296,7 +296,8 @@ int os_file_size(char *file, unsigned lo
 	}
 
 	if(S_ISBLK(buf.ust_mode)){
-		int fd, blocks;
+		int fd;
+		long blocks;
 
 		fd = os_open_file(file, of_read(OPENFLAGS()), 0);
 		if(fd < 0){

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel