Commit:     2c392a4f47f41b24432e6aa77bb5167d0bbb10c5
Parent:     3558c9b3232b5f0fd9f32043a191eca20fca64c6
Author:     Nicolas George <[EMAIL PROTECTED]>
AuthorDate: Tue Sep 18 22:46:21 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Wed Sep 19 11:24:17 2007 -0700

    uml: use correct type in BLKGETSIZE ioctl
    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.
    Cc: Jeff Dike <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
 arch/um/os-Linux/file.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

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)
-               int fd, blocks;
+               int fd;
+               long blocks;
                fd = os_open_file(file, of_read(OPENFLAGS()), 0);
                if(fd < 0){
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to