From: Theodore Tso <tytso@mit.edu>
To: Daniel Phillips <phillips@phunq.net>
Cc: linux-ext4@vger.kernel.org
Subject: Re: Dot and dotdot need to be physically present?
Date: Wed, 13 Aug 2008 23:47:01 -0400 [thread overview]
Message-ID: <20080814034701.GC6469@mit.edu> (raw)
In-Reply-To: <200808131636.59436.phillips@phunq.net>
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
next prev parent reply other threads:[~2008-08-14 3:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-13 23:36 Dot and dotdot need to be physically present? Daniel Phillips
2008-08-14 3:47 ` Theodore Tso [this message]
2008-08-20 23:52 ` Daniel Phillips
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080814034701.GC6469@mit.edu \
--to=tytso@mit.edu \
--cc=linux-ext4@vger.kernel.org \
--cc=phillips@phunq.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox