On Sun, 13 Nov 2005, Anton Altaparmakov wrote:
> On Sun, 13 Nov 2005, Szabolcs Szakacsits wrote:
> > Changes by: szaka
> >
> > Update of /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs
> > In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4415/ntfsprogs
> >
> > Modified Files:
> > mkntfs.c
> > Log Message:
> > Fix fs creation with 32 and 64 kB cluster size; also if only one cluster
> > contains all system files then fill the rest of it with empty, formatted
> > records as 'format' also does
>
> Now I am confused.
I was too for a while when I realised that the above is needed in _some_
cases.
> That code was there before (well ok, code of equivalent functionality).
Actually it wasn't exactly equivalent, only almost. That code always
rounded up the mft size to cluster boundary, this one only if all system
files fits into the first cluster. New, empty records are added also only
in this case, not otherwise.
In short none of us was right, the truth is between them.
> You ripped it out saying that it wasn't true anymore
It wasn't using upto 16 kB cluster sizes but it was almost ok for bigger
ones.
> and now you are fixing a problem by bringing it back in?
It's back only for 32 and 64 kB cluster sizes, not for others.
> Curious... So what was wrong with my code then?
It did the same for all cluster sizes but rounding and empty record filling
is needed only for 32 and 64 kB cluster sizes.
> Also note that AFAICS your so called fix is incomplete as it does not
> extend the mft mirror to cover the number of mft records stored in a
> cluster (althought this may be happening automatically elsewhere, don't
> know anymore what mkntfs looks like these days...).
It happens the same way as before during "Updating $MFTMirr".
I test with the below script and mkntfs works fine with all cluster sizes
again.
ElectricFence:
=====> 512 SUCCESS
=====> 1024 SUCCESS
=====> 2048 SUCCESS
=====> 4096 SUCCESS
=====> 8192 SUCCESS
=====> 16384 SUCCESS
=====> 32768 SUCCESS
=====> 65536 SUCCESS
Normal:
=====> 512 SUCCESS
=====> 1024 SUCCESS
=====> 2048 SUCCESS
=====> 4096 SUCCESS
=====> 8192 SUCCESS
=====> 16384 SUCCESS
=====> 32768 SUCCESS
=====> 65536 SUCCESS
---------------------------------------------------------------->
#!/bin/sh
touch mkntfs.img
cd /tmp
do_test() {
for i in `seq 9 16` ; do
BS=`echo "2^$i" | bc`
echo -n "=====> $BS "
rm mkntfs.img
touch mkntfs.img
$EF mkntfs -Ff -c $BS mkntfs.img 34359738 2> /dev/null > /dev/null && \
ntfsresize -fi mkntfs.img > /dev/null && \
echo SUCCESS || echo FAILED
done
}
echo ElectricFence:
EF=ef; do_test
echo Normal:
unset EF; do_test
<----------------------------------------------------------------
And this is what's left for mkntfs v3.1:
Inode 0 attribute 0x30 content: DIFFER
Inode 0 attribute 0x80 content: DIFFER
Inode 1 attribute 0x80 content: DIFFER
Inode 2 attribute 0x30 content: DIFFER
Inode 2 attribute 0x80 length: 46153728 != 4194304
Inode 4 attribute 0x30 content: DIFFER
Inode 5 attribute 0x50 length: 4144 != 4608
Inode 5 attribute 0xa0:$I30 content: DIFFER
Inode 6 attribute 0x80 content: DIFFER
Inode 7 attribute 0x80 content: DIFFER
Inode 9 attribute 0x30 content: DIFFER
Inode 9 attribute 0x80:$SDS length: 262396 != 262720
Inode 9 attribute 0x90:$SDH length: 144 != 288
Inode 9 attribute 0x90:$SII length: 128 != 248
Inode 11 attribute 0x90:$I30 content: DIFFER
Inode 24 attribute 0x90:$O content: DIFFER
Inode 24 attribute 0x90:$Q content: DIFFER
Szaka
|