[comp.unix.microport] . and .. get blown away when directory size > 65536 UPORT286

karl@sugar.UUCP (Karl Lehenbauer) (06/12/88)

I'm not exactly sure that this is what happened, but it appears that when
a directory reaches 65536 bytes in size under Microport System V/AT it
wraps around and the next two files created cause . and .. to get blown
away, trashing the directory.

The symptoms are:

The directory has an indicated size of 65536 bytes.
A cd to the directory and ls results in ". not found"
If one cd's to the directory above it and does an ls on the messed-up 
directory, one gets a message for every name in the directory that the file
is not found.
An rm -r of the directory causes it to print around 4096 file not found 
messages then refuses to delete the directory because it says there's 
still stuff in it.

I used fsdb to change the size of the directory to zero then let fsck trash
all the files.  I think it would be possible to trash a couple entries
in the directory then create valid . and .. files.  I don't know if the
kernel assumes they're the first two files.  It might be a good idea to
assume it does.

Please, no flames as to how hosed it is to have this many files.  It was an
accident, but one whose impact would have been significantly less had the
directory not been blown away by it.

ebeser@ajpo.sei.cmu.edu (Eric Beser) (06/28/88)

In article <2104@sugar.UUCP>, karl@sugar.UUCP (Karl Lehenbauer) writes:
> I'm not exactly sure that this is what happened, but it appears that when
> a directory reaches 65536 bytes in size under Microport System V/AT it
> wraps around and the next two files created cause . and .. to get blown
> away, trashing the directory.
> 
I have had this problem when usenet sends large amounts of files. I have
found  a multitude of problems caused by this. I noticed that other
directories in the inode chain get blown away too.

> I used fsdb to change the size of the directory to zero then let fsck trash
> all the files.  I think it would be possible to trash a couple entries
> in the directory then create valid . and .. files.  I don't know if the
> kernel assumes they're the first two files.  It might be a good idea to
> assume it does.

Would someone please tell me how to use fsdb to do this. I am sitting
with a system with about 10 directories that have been trashed.
The manual has no indication of how to use fsdb. Is there any books that
have more detailed information that I can read? 

Thanks.

Eric Beser
Westinghouse ESG
arpa : ebeser@ajpo.sei.cmu.edu
usenet:eric@sarin.UUCP
(301)-765-1360