On Tue, 2004-03-02 at 14:24, Szakacsits Szabolcs wrote:
> As people started to use and report issues with volumes over a terrabyte,
> I'm creating some test cases.
>
> The first try immediately segfaulted:
>
> touch ntfs.img
> mkntfs -FQ -c 512 ntfs.img 3000000000
>
> Problem is integer overflow at:
>
> 2783: for (i = opts.nr_clusters; i < lcn_bitmap_byte_size << 3; i++)
> 2784: ntfs_bit_set(lcn_bitmap, (u64)i, 1);
>
> i and lcn_bitmap_byte_size are int, nr_clusters is long long. However
> there is a comment in the source on nr_clusters, "Note: Win2k treats
> clusters as 32-bit entities!"
Hi Szaka,
Thanks for the report.
I have fixed this in latest BK and latest snapshots. We now increase
the cluster size until the number of clusters go below 32 bits or the
max cluster size is reached (64kiB) and then we exit with an appropriate
error message that the max device size is 256TiB but I think people will
be hard push to hit this one for a while...
Best regards,
Anton
--
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK
Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net
WWW: http://linux-ntfs.sf.net/ &
http://www-stu.christs.cam.ac.uk/~aia21/
|