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.
Looks like this should use sizeof(u32) instead of sizeof(unsigned long).
With the diff below, I'm able to mount a NTFS partition and all seems
well.
BTW, in the light of x86-64 Hardware slated for 1Q 2003, shouldn't the
driver be changed to use 64 bits on platforms where it's the native size,
i.e. BITS_PER_LONG == 64? With this platform it will get fairly common to
have 64 bit machines that also have NTFS partitions.
Philipp
2003-03-25 Philipp Thomas <pt...@su...>
* super.c (parse_ntfs_boot_sector): Use u32 not unsigned long
to check for the use of 64 bits.
--- fs/ntfs.old/super.c 2003-03-17 22:44:20.000000000 +0100
+++ fs/ntfs/super.c 2003-03-25 18:17:00.000000000 +0100
@@ -619,9 +619,9 @@
* the same as it is much faster on 32-bit CPUs.
*/
ll = sle64_to_cpu(b->number_of_sectors) >> sectors_per_cluster_bits;
- if ((u64)ll >= 1ULL << (sizeof(unsigned long) * 8)) {
+ if ((u64)ll >= 1ULL << (sizeof(u32) * 8)) {
ntfs_error(vol->sb, "Cannot handle %i-bit clusters. Sorry.",
- sizeof(unsigned long) * 4);
+ sizeof(u32) * 4);
return FALSE;
}
vol->nr_clusters = ll;
--
Philipp Thomas <pt...@su...>
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nuremberg, Germany
|