From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sc8-sf-mx2-b.sourceforge.net ([10.3.1.92] helo=mail.sourceforge.net) by sc8-sf-list1-new.sourceforge.net with esmtp (Exim 4.43) id 1IMCOD-0008Sh-Qd for user-mode-linux-devel@lists.sourceforge.net; Fri, 17 Aug 2007 17:42:06 -0700 Received: from saraswathi.solana.com ([198.99.130.12]) by mail.sourceforge.net with esmtps (TLSv1:AES256-SHA:256) (Exim 4.44) id 1IMCOB-0001yo-18 for user-mode-linux-devel@lists.sourceforge.net; Fri, 17 Aug 2007 17:42:05 -0700 Date: Fri, 17 Aug 2007 15:43:40 -0400 From: Jeff Dike Message-ID: <20070817194340.GA8739@c2.user-mode-linux.org> Mime-Version: 1.0 Content-Disposition: inline Subject: [uml-devel] [PATCH 2/6] UML - Use 64-bits for block size on x86_64 List-Id: The user-mode Linux development list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: user-mode-linux-devel-bounces@lists.sourceforge.net Errors-To: user-mode-linux-devel-bounces@lists.sourceforge.net To: Andrew Morton Cc: Nicolas George , LKML , uml-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 Signed-off-by: Jeff Dike -- arch/um/os-Linux/file.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) Index: linux-2.6.22/arch/um/os-Linux/file.c =================================================================== --- linux-2.6.22.orig/arch/um/os-Linux/file.c 2007-08-17 13:36:35.000000000 -0400 +++ linux-2.6.22/arch/um/os-Linux/file.c 2007-08-17 13:37:55.000000000 -0400 @@ -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){ ------------------------------------------------------------------------- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755994AbXHRAoX (ORCPT ); Fri, 17 Aug 2007 20:44:23 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1759448AbXHRAmx (ORCPT ); Fri, 17 Aug 2007 20:42:53 -0400 Received: from saraswathi.solana.com ([198.99.130.12]:57734 "EHLO saraswathi.solana.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758349AbXHRAmU (ORCPT ); Fri, 17 Aug 2007 20:42:20 -0400 Date: Fri, 17 Aug 2007 15:43:40 -0400 From: Jeff Dike To: Andrew Morton Cc: LKML , uml-devel , Nicolas George Subject: [PATCH 2/6] UML - Use 64-bits for block size on x86_64 Message-ID: <20070817194340.GA8739@c2.user-mode-linux.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.3i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org 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 -- arch/um/os-Linux/file.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) Index: linux-2.6.22/arch/um/os-Linux/file.c =================================================================== --- linux-2.6.22.orig/arch/um/os-Linux/file.c 2007-08-17 13:36:35.000000000 -0400 +++ linux-2.6.22/arch/um/os-Linux/file.c 2007-08-17 13:37:55.000000000 -0400 @@ -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){