Hi,
> On Fri, Aug 26, 2005 at 04:09:41PM +0100, Anton Altaparmakov wrote:
> > I am afraid your code for file/directory creation is broken. After
> > accessing volume with ntfsmount and creating some files in the root
> > directory running chkdsk I get:
[snip]
What it can cause is that the index is sorted wrong. This means that when
you do "ls" you see all the files (for readdir() we just return all
entries in the index in order of appearance, i.e. not sorted or anything,
the ls command does the sorting). But when you do say "cat filename" and
filename happens to be wrongly sorted, you get -ENOENT, "File not found."
this is because the indexing function looked for the file but did not find
it.
Interestingly, the bug I thought was the problem was actually not the
problem because by pure chance the code treated the "unhandled error code"
the same way as a +1 collation, i.e. continue searching the index. And
this is what the index lookup code does as well (both in Linux NTFS and
Windows NTFS.sys), so by pure chance it actually happened to work.
Thus I don't actually understand what was wrong with the index at all. It
doesn't appear to be what I thought it was. I had remembered wrong that
it should be -1 collation when in fact it should be +1 collation which is
exactly how the code treated it.
So I think the actual problem is still unknown.
But anyway, I explained why it is a "serious" bug IMO. I don't like
seeing "ls" followed by "cat fileseeninls" not working and a wrongly
sorted index can lead to exactly that.
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/
|