[comp.sys.amiga.tech] Validation error hack and question

Chuck.Phillips@FtCollins.NCR.COM (Chuck.Phillips) (08/09/90)

>>>>> On 28 Jul 90 17:11:16 GMT, Bill.Carney@f625.n159.z1.FIDONET.ORG (Bill Carney) said:
Bill> You'll have to backup and then reformat that partition.  Happens all
Bill> the time, especially if the system gurus in the middle of a write to
Bill> the HD.

_Often_, you can get rid of the validation error by simply deleting the
file(s) being written to (or left open) when the system guru'ed.

Doesn't always work, but it usually has for me.  The trick is to identify
which files were open when the system crashed.  (I _assume_ only files left
open for writing would be affected, but I haven't had the nerve to engage
in thorough testing of this on my own hard drive. :-)

Question for the OS/disk experts: Is it possible for an AmigaOS program to
open a file for writing and then exit _normally_ (no guru or power failure)
without closing the file, possibly creating a validation error?  (Exclude
programs directly accessing the disk device)

Question for C=: If this is possible, are there plans to correct this in a
future release?

	Regards,
--
Chuck Phillips  MS440
NCR Microelectronics 			Chuck.Phillips%FtCollins.NCR.com
2001 Danfield Ct.
Ft. Collins, CO.  80525   		uunet!ncrlnk!ncr-mpd!bach!chuckp

jesup@cbmvax.commodore.com (Randell Jesup) (08/11/90)

In article <CHUCK.PHILLIPS.90Aug9130916@halley.FtCollins.NCR.COM> Chuck.Phillips@FtCollins.NCR.COM (Chuck.Phillips) writes:
>Question for the OS/disk experts: Is it possible for an AmigaOS program to
>open a file for writing and then exit _normally_ (no guru or power failure)
>without closing the file, possibly creating a validation error?  (Exclude
>programs directly accessing the disk device)

	Sure, those could certainly cause validation to be needed (but no
problems are likely to result in most cases).

>Question for C=: If this is possible, are there plans to correct this in a
>future release?

	It would be hard, since we don't know why the file was left open,
even if we tracked what files a process opens.  Maybe the FH was passed to
another process.

-- 
Randell Jesup, Keeper of AmigaDos, Commodore Engineering.
{uunet|rutgers}!cbmvax!jesup, jesup@cbmvax.cbm.commodore.com  BIX: rjesup  
Common phrase heard at Amiga Devcon '89: "It's in there!"

Chuck.Phillips@FtCollins.NCR.COM (Chuck.Phillips) (08/13/90)

In article <CHUCK.PHILLIPS.90Aug9130916@halley.FtCollins.NCR.COM> Chuck.Phillips@FtCollins.NCR.COM (Chuck.Phillips) writes:
>Question for the OS/disk experts: Is it possible for an AmigaOS program to
>open a file for writing and then exit _normally_ (no guru or power failure)
>without closing the file, possibly creating a validation error?  (Exclude
>programs directly accessing the disk device)

>>>>> On 10 Aug 90 21:14:54 GMT, jesup@cbmvax.commodore.com (Randell Jesup) said:
Randell> Sure, those could certainly cause validation to be needed (but no
Randell> problems are likely to result in most cases).

>Question for C=: If this is possible, are there plans to correct this in a
>future release?

Randell> It would be hard, since we don't know why the file was left open,
Randell> even if we tracked what files a process opens.  Maybe the FH was
Randell> passed to another process.

Thanks for the response.  Another question:

Is it possible to write a program that will simply close every open file on
a device? (Possibly prompting the user interactively) DiskDoctor seems like
extreme overkill to handle these cases; it also has the effect of
undeleting lots of files I really don't want to have to clean up again.

If someone could mail or post a program (or C fragment) that does this, it
would be greatly appreciated.  No fancy interface required.

	Thanks in advance,
--
Chuck Phillips  MS440
NCR Microelectronics 			Chuck.Phillips%FtCollins.NCR.com
2001 Danfield Ct.
Ft. Collins, CO.  80525   		uunet!ncrlnk!ncr-mpd!bach!chuckp

steveb@cbmvax.commodore.com (Steve Beats) (08/14/90)

In article <CHUCK.PHILLIPS.90Aug13103227@halley.FtCollins.NCR.COM> Chuck.Phillips@FtCollins.NCR.COM (Chuck.Phillips) writes:
>
>Is it possible to write a program that will simply close every open file on
>a device? (Possibly prompting the user interactively) DiskDoctor seems like
>extreme overkill to handle these cases; it also has the effect of
>undeleting lots of files I really don't want to have to clean up again.

Under 2.0 files that are left open are no different from files that have been
closed.  While there will be a lock and a filehandle hanging around (preventing
other processes from deleting/modifying the file) the format on disk is
identical.  2.0 does all updates on the disk copy of the fileheader and
bitmap so that the file is never in an unknown state.  1.3 and previous
versions of the FS kept the fileheader and bitmap information in memory,
only flushing it out when the file was closed.  This was the prime cause
of many of the "key already set" requesters after a crash.

Rebooting the computer will release all hanging filehandles and locks.

	Steve

Chuck.Phillips@FtCollins.NCR.COM (Chuck.Phillips) (08/14/90)

>>>>> On 14 Aug 90 09:53:47 GMT, steveb@cbmvax.commodore.com (Steve Beats) said:

Steve> Under 2.0 files that are left open are no different from files that
Steve> have been closed.  While there will be a lock and a filehandle
Steve> hanging around (preventing other processes from deleting/modifying
Steve> the file) the format on disk is identical.

Uh, so is there a fix for _this_ then?

	Thanks in advance,
--
Chuck Phillips  MS440
NCR Microelectronics 			Chuck.Phillips%FtCollins.NCR.com
2001 Danfield Ct.
Ft. Collins, CO.  80525   		uunet!ncrlnk!ncr-mpd!bach!chuckp