Hi,
Sorry for the delay in replying.
On Tue, 25 Mar 2003, Philipp Thomas wrote:
> The latest NTFS code in 2.5.65 still has this code in
> super.c(parse_ntfs_boot_sector):
>
> /*
> * Get the size of the volume in clusters and check for 64-bit-ness.
> * Windows currently only uses 32 bits to save the clusters so we do
> * the same as it is much faster on 32-bit CPUs.
> */
> if ((u64)ll >= 1ULL << (sizeof(unsigned long) * 8)) {
> ntfs_error(vol->sb, "Cannot handle %i-bit clusters. Sorry.",
> sizeof(unsigned long) * 4);
> return FALSE;
> }
>
> Now on AMD64 (aka x86-64, Hammer), long is 64 bit wide, so the test resolves to:
>
> (u64 >= 1ULL << 64)
>
> which effectively is
>
> (u64 >= 0)
>
> So, as expected, mounting a NTFS partiton fails.
Grrr. Silly 64 bit architectures. The above test was designed with ULL =
128 bit in mind and not ULL = UL which the x86-64 seems to have. The test
really should only be:
if ((u64)ll >= (1ULL << 32)) {
ntfs_error(vol->sb, "Cannot handle 64-bit clusters. Sorry.");
return FALSE;
}
Best regards,
Anton
--
Anton Altaparmakov <aia21 at cantab.net> (replace at with @)
Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net
WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/
|