From: Jeff Dike 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 Signed-off-by: Jeff Dike Signed-off-by: Andrew Morton --- arch/um/os-Linux/file.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) diff -puN arch/um/os-Linux/file.c~uml-use-64-bits-for-block-size-on-x86_64 arch/um/os-Linux/file.c --- a/arch/um/os-Linux/file.c~uml-use-64-bits-for-block-size-on-x86_64 +++ a/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){ _