Hi. I found a type mismatch in UML that makes host block devices unusable as ubd devices on x86_64 and other 64 bits systems (segfault of the mm subsystem): In block/ioctl.c, the following lines show that the BLKGETSIZE ioctl expects a pointer to a long: case BLKGETSIZE: if ((bdev->bd_inode->i_size >> 9) > ~0UL) return -EFBIG; return put_ulong(arg, bdev->bd_inode->i_size >> 9); In arch/um/os-Linux/file.c, os_file_size calls it with an int. The ioctl_list man page should be fixed as well. Regards, -- Nicolas George
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){
Attachment:
signature.asc
Description: Digital signature
- Follow-Ups:
- Re: UML/man: BLKGETSIZE takes a long, not an int
- From: Jeff Dike <[email protected]>
- Re: UML/man: BLKGETSIZE takes a long, not an int
- Prev by Date: Re: [GIT PATCH] scsi bug fixes for 2.6.23-rc2
- Next by Date: Re: [RFD] Layering: Use-Case Composers (was: DRBD - what is it, anyways? [compare with e.g. NBD + MD raid])
- Previous by thread: linux 2.6.23-rc3 - compile warnings (x86)
- Next by thread: Re: UML/man: BLKGETSIZE takes a long, not an int
- Index(es):