* [uml-devel] [PATCH] UML: BLKGETSIZE takes a long, not an int
[not found] ` <20070815171247.GA7948@c2.user-mode-linux.org>
@ 2007-08-15 21:38 ` Nicolas George
2007-08-16 14:48 ` Jeff Dike
0 siblings, 1 reply; 2+ messages in thread
From: Nicolas George @ 2007-08-15 21:38 UTC (permalink / raw)
To: Jeff Dike; +Cc: linux-kernel, user-mode-linux-devel
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.
Signed-off-by: Nicolas George <nicolas.george@normalesup.org>
---
Jeff Dike wrote:
> Looks sane, can I have a properly Signed-off-by: version of the patch?
Of course. I should have sent it correctly the first time. And I am terribly
sorry for the mess my mailer have done with my second mail.
Here is the hopefully correct patch, against current git.
Regards.
diff --git a/arch/um/os-Linux/file.c b/arch/um/os-Linux/file.c
index 6f92f73..c3ecc2a 100644
--- a/arch/um/os-Linux/file.c
+++ b/arch/um/os-Linux/file.c
@@ -320,7 +320,8 @@ int os_file_size(char *file, unsigned long long *size_out)
}
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
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply related [flat|nested] 2+ messages in thread