Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Mlmg7-0007lD-PG for mharc-grub-devel@gnu.org; Thu, 10 Sep 2009 12:39:23 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mlmg6-0007kn-6x for grub-devel@gnu.org; Thu, 10 Sep 2009 12:39:22 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mlmg0-0007iK-Fb for grub-devel@gnu.org; Thu, 10 Sep 2009 12:39:20 -0400 Received: from [199.232.76.173] (port=48689 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mlmg0-0007iB-9U for grub-devel@gnu.org; Thu, 10 Sep 2009 12:39:16 -0400 Received: from smarthost02.mail.zen.net.uk ([212.23.3.141]:58331) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mlmfz-0005lH-Td for grub-devel@gnu.org; Thu, 10 Sep 2009 12:39:16 -0400 Received: from [82.69.40.219] (helo=riva.pelham.vpn.ucam.org) by smarthost02.mail.zen.net.uk with esmtp (Exim 4.63) (envelope-from ) id 1Mlmfz-0000F0-9Y; Thu, 10 Sep 2009 16:39:15 +0000 Received: from cjwatson by riva.pelham.vpn.ucam.org with local (Exim 3.36 #1 (Debian)) id 1Mlmfy-0002l3-00; Thu, 10 Sep 2009 17:39:14 +0100 Date: Thu, 10 Sep 2009 17:39:14 +0100 From: Colin Watson To: grub-devel@gnu.org Message-ID: <20090910163914.GB13423@riva.ucam.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) X-Originating-Smarthost02-IP: [82.69.40.219] X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: Agostino Russo Subject: [PATCH] 64-bit file sizes in NTFS X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Sep 2009 16:39:22 -0000 NTFS "non-resident" files (i.e. ones for which pa[8] is true) may have 64-bit sizes. This patch updates GRUB's NTFS driver to understand this. (I ran into this when helping out one of the Wubi developers who was trying to use 'loopback' to look inside an ext3 filesystem image stored on an NTFS filesystem, and wondering why he was getting "out of disk" errors. Also, obviously, I didn't refer to Microsoft code in the process of fixing this.) 2009-09-10 Colin Watson * include/grub/ntfs.h (struct grub_fshelp_node): Change `size' to grub_uint64_t. * fs/ntfs.c (init_file): Understand 64-bit sizes for non-resident files. Index: include/grub/ntfs.h =================================================================== --- include/grub/ntfs.h (revision 2584) +++ include/grub/ntfs.h (working copy) @@ -133,7 +133,7 @@ struct grub_fshelp_node { struct grub_ntfs_data *data; char *buf; - grub_uint32_t size; + grub_uint64_t size; grub_uint32_t ino; int inode_read; struct grub_ntfs_attr attr; Index: fs/ntfs.c =================================================================== --- fs/ntfs.c (revision 2584) +++ fs/ntfs.c (working copy) @@ -543,7 +543,7 @@ init_file (struct grub_ntfs_file *mft, grub_uint32 if (!pa[8]) mft->size = u32at (pa, 0x10); else - mft->size = u32at (pa, 0x30); + mft->size = u64at (pa, 0x30); if ((mft->attr.flags & AF_ALST) == 0) mft->attr.attr_end = 0; /* Don't jump to attribute list */ -- Colin Watson [cjwatson@ubuntu.com]