Re: Dot and dotdot need to be physically present?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Aug 13, 2008 at 04:36:59PM -0700, Daniel Phillips wrote:
> 
> Many years ago we had a discussion about whether or not the . and ..
> directory entries had to be physically present in htree, and I remember
> the conclusion was that they had to be, but I forget the argument and
> lost track of the email thread.  I think the VFS will happily supply
> the . and .. entries to getdents on its own.  So what was the issue?
> Something about telldir?

. and .. are needed for backwards compatibility.  If you aren't going
to do backwards compatibility, then you might as well not bother
putting the btree in the directory nodes.  Just use physically block
numbers directly.

The other reason why '..' is useful is that it helps to knit the
fliesystem back together in case of corruption.  (For example, e2fsck
uses the '..' so we can display full pathnames which is very helpful
to system administrators.)

The '.' pointer is slightly less useful, but it is helpful as an
additional sanity check.

If I were doing things all over in a completely incompatible way, I'd
probably put at the beginning of the first directory block (a) a magic
number, (b) the current inode number (as a sanity check), (c) the
parent inode number (i.e., '..'), and (d) a pointer to a physical
block which is the root of the index tree. 

      	       	   	       	     	   - Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux