LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Nicolas George <nicolas.george@ens.fr>
To: linux-kernel@vger.kernel.org,
	user-mode-linux-devel@lists.sourceforge.net,
	jdike@linux.intel.com, mtk-manpages@gmx.net
Date: Tue, 14 Aug 2007 11:29:42 +0200	[thread overview]
Message-ID: <20070814092942.GA14324@clipper.ens.fr> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 966 bytes --]

Cc: 
Bcc: 
Subject: Re: UML/man: BLKGETSIZE takes a long, not an int
Reply-To: 
In-Reply-To: <20070813124247.GA7414@she-seel.salle-s.org>

Hi.

I fear that my bug-report yesterday was very badly written, with me writing
to the wrong mailing-list and all.

I was saying:

> 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.

I add that the bug was still there yesterday in the git repository.

I join the patch to file.c.

Regards,

-- 
  Nicolas George

[-- Attachment #1.2: linux-umlblkgetsize-20070813.diff --]
[-- Type: text/plain, Size: 397 bytes --]

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 #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 185 bytes --]

             reply	other threads:[~2007-08-14 10:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-14  9:29 Nicolas George [this message]
2007-08-27 13:25 ` UML/man: BLKGETSIZE takes a long, not an int Michael Kerrisk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070814092942.GA14324@clipper.ens.fr \
    --to=nicolas.george@ens.fr \
    --cc=jdike@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mtk-manpages@gmx.net \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    --subject='Re: ' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).