Can directory files have holes in them ?

Naim Abdullah CSRL naim at accuvax.nwu.edu
Thu Oct 5 09:10:09 AEST 1989


In 4.3bsd, is it possible for a directory file to have holes
in it ?

By this I mean:

struct dinode *ip;

ip = ... ; /* set it to a directory inode */
(ip->di_db[i] == 0) && (ip->di_db[j] != 0) && (i < j)

And what about indirect blocks (assuming a really HUGE directory). Is it
possible to have:

(ip->di_ib[i] == 0) && (ip->di_ib[j] != 0) && (i < j)


It seems to me that since the kernel is the only one that writes directory
blocks, it should be easy to ensure that no holes are present in a directory
file. But I don't know if the 4.3bsd kernel bothers to do this, hence the
question.

Thanks.

		      Naim Abdullah
		      Dept. of EECS,
		      Northwestern University

		      Internet: naim at eecs.nwu.edu
		      Uucp: {oddjob, chinet, att}!nucsrl!naim


P.S: The reason for this question is that dumptraverse.c in the source
for dump, is careful enough to handle directory files with holes in them.
When I was browsing through it, I noticed this and I was wondering if this
was just good and healthy programmer paranoia or whether this can really
happen.




More information about the Comp.unix.wizards mailing list