On Fri, 9 Apr 2004, Szakacsits Szabolcs wrote:
> On Fri, 9 Apr 2004, Anton Altaparmakov wrote:
> > On Fri, 9 Apr 2004, Szakacsits Szabolcs wrote:
> > > Apparently NTFS 3.1 says so. You never checked?
> >
> > What do you mean by NTFS 3.1? Do you mean the NTFS driver that comes with
> > XP? The one with XPSP1? The one with XPSP2? The one with 2003 or
> > Longhorn? Note all these drivers are things like version 5.1, etc. NTFS
> > 3.1 is the NTFS specification not the driver.
>
> I mean NTFS 3.1. So I mean all drivers that supports NTFS 3.1. But note,
> again, this feature doesn't break anything. If a driver knows about this
> flag/feature then it can query the state otherwise it does recovery, just
> as before.
>
> If you like, forget everything about NTFS versions and distinguishing NTFS
> and LFS. Just focus on that bit. It would be backward compatible, there
> would have been no need to bump up LFS version because that could break
> compatibility.
True. Although the LFS drivers are quite happy to recognise any LFS
version including strange ones likes 0.-1...
> > Certainly on my XPSP1 test system, I see differences between crashed NTFS
> > and cleanly shutdown NTFS in the $LogFile restart pages. And the
> > differences are as I have described in include/ntfs/logfile.h.
>
> That's interesting since on my XPSP1 none of the dirty related comments
> are right.
>
> Ok, let's take those comments in order:
>
> RESTART_AREA:
>
> "client_free_list At present on dirty volume this is 0xffff."
>
> Always -1.
>
> "client_in_use_list On a clean volume this is 0xffff. On a dirty
> volume this is != 0xffff. At present on dirty
> volume this is 0."
> Always 0.
>
> "unknown; It seems like it = 0 if clean and it != 0
> if dirty."
>
> This seems to be a counter related to the total number of checkpoints or
> number of event logs or something like that.
>
> LOG_CLIENT_RECORD:
>
> "seq_number; ??? It is 1 when clean and 0 when dirty,
> but don't know if this is always the case."
>
> Always 0.
>
> > > > It certainly isn't the case for LFS 1.1 (the only one I know about).
> > > > I believe XP uses LFS 1.1, too (as do NT4 and Win2k).
> > >
> > > AFAIK, the only LFS user is NTFS. NTFS 3.0 and earlier isn't able to
> > > access/mount NTFS 3.1. So NTFS 3.1 LFS version could be anything.
> >
> > Yes, LFS allows only one client registration per logfile. And yes only
> > NTFS uses LFS I believe. NTFS 3.1 LFS makes no sense. NTFS and LFS are
> > quite separate things...
>
> True from pedantry point of view but I doubt even Microsoft cares. Show me
> an example when LFS is used outside of NTFS.
I don't know any. I don't think anything other than NTFS uses LFS.
> > Also make sure to crash windows at least once while idle and at least once
> > while it is doing active i/o. (E.g. use explorer to start copying your
> > Program Files directory to your temp directory or something like that and
> > when your HD is going like mad, press the reset button.)
>
> That's not ok. Some cases send reset notifications to the OS and they can
> do a fast flush. Just unplug the power cable (for your own risk).
>
> Of course you could also sniff the journal events by Captive NTFS, VMware,
> etc.
>
> > > If Windows is XP/W2K3/Longhorn then
> > >
> > > flags = 2 apparently means clean shutdown, no recovery needed
> > > flags = 0 means unknows state, recovery needed
> >
> > I have never seen the flags be anything other than 0 on XPSP1 and W2K.
>
> OK but that's not rebuttal.
I have to apologise at this point: I must have somehow managed to muddle
my logfile copies. I took a new copy just now and it is just like you say
and nothing like my old copy. So I must have been working with w2k rather
than xp logfile all along. )-:
I can confirm the same as you see.
This makes everything even more difficult. We will need to parse the NTFS
version and then deal with the logfile depending on what we see there. So
on NTFS 3.1 with LFS 1.1, we will compare the restart pages (_not_ binary
compare but logical compare) and if identical and flags = 2 we can say
clean and dirty otherwise. And on NTFS 1.x, 2.x, and 3.0 with LFS 1.1 we
need to check the restart pages and if identical and the criteria I
describe in ntfs/logfile.h are met (i.e. the logfile is shut, no clients
are registered in use) it is clean and assumed dirty otherwise (although
it could still be clean in that case but that is too complicated for us to
figure out at this point as it involves parsing the whole logfile and
checking that all ops are checkpointed). Anyway, it is better to be
erring on the safe side IMO. We can always provide a force option for
ignoring the fact that we think the journal is dirty. Without the force
we just work read-only.
The above should cover all NTFS and LFS versions in use outside of MS and
perhaps beta-testers of early windows nt 3.x versions but I suspect there
aren't any of those around nowadays...
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/
|