On Fri, 2004-03-12 at 17:05, Szakacsits Szabolcs wrote:
> On Fri, 12 Mar 2004, Szakacsits Szabolcs wrote:
> > On Fri, 12 Mar 2004, Anton Altaparmakov wrote:
> >
> > > "Modify meaning of ntfs_volume->nr_mft_records to be the number of
> > > initialized mft records, not total mft records. This makes far more
> > > sense and in fact reflects how nr_mft_records is being used in both
> > > libntfs and the utilities."
> > [...]
> > > Could people using nr_mft_records in their applications double check for
> > > me and tell me if this is a problem for them?
> >
> > This totally and fatally breaks ntfsresize and ntfsclone.
>
> Well, maybe not. It depends what you mean under "initialized mft records".
> I've seen many uninitialized mft records records in between initialized
> mft records. However if you mean the uninitialized mft records at the end
> then it shouldn't be a problem.
Yes, sorry if I wasn't explaining well what I meant, I am talking about:
nr_mft_records = $MFT/$DATA attribute->initialized_size >>
vol->mft_record_size_bits;
instead of the old one which was:
nr_mft_records = $MFT/$DATA attribute->data_size >>
vol->mft_record_size_bits;
You see, if data_size > initialized_size the mft records between the two
sizes is going to be just a run of zeroes when attr_pread() is called
(this eventually happens at the lowest level in libntfs). When this is
passed up the reading layers, libntfs will attempt to mst deprotect
after read which will fail due to no fixups and will place BAAD at the
front of each "uninitialized record" this will cause
ntfs_file_record_read() to fail returning EIO. And this will cause
ntfs_inode_open() to fail with EIO. So if anything applications trying
to read between initialized_size and data_size may well actually be
broken unless they are very careful...
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/
|