From: "Theodore Ts'o" <tytso@mit.edu>
To: Emmanuel Colbus <ecolbus@manux.info>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [RFC][6/11][MANUX] Kernel compatibility : directory hardlinks
Date: Tue, 15 Apr 2014 18:01:19 -0400 [thread overview]
Message-ID: <20140415220119.GM4456@thunk.org> (raw)
In-Reply-To: <534D9C44.1050505@manux.info>
On Tue, Apr 15, 2014 at 10:53:24PM +0200, Emmanuel Colbus wrote:
> Well, I can give you this information, but first, I would like to
> mention that, since Alan Cox has pointed out the fact that the best
> thing for me was to simply use a modified ELF header and route my own
> syscalls this way, this information has become completely irrelevant. I
> mean, since this value would only appear in my little personal ext2l
> partitions, and in my own little syscalls, there is no point for you to
> do anything anymore, not even reserve it. So, to make it clear, I fully
> retract my previous demand.
The ELF header works fine for your own programs. The file system
format changes only matter if you care about interoperability or
future proofing with ext4. If it's only for a toy operating system,
then it won't matter, of course. But if you're going to depend on
e2fsprogs, or a version of e2fsprogs with your local changes, it's
going to be on you to make it work.
> This value is
> simply stored within the fragment address, as my ext2l partitions don't
> support fragmentation. As for the kernel, it uses these a little bit
> like automatic mountpoint that can't cross partition limits.
We currently using the fragment address for anything (yet), but that
could change in the future, as it's the last unallocated 32-bit field
in the inode. (I suspect we'll end up using it to support per-block
metdadata, which would be needed to support data block checksums and
reflinks, among other things).
The fragment number is currently being used to support file systems
larger than 16TB (i_file_acl_high).
> The value means that the file is not a true directory, but a directory
> hardlink. Directory hardlinks, which only appear in my ro-compatible
> ext2l partitions, are special files that have no content, and simply
> point to a directory inode by using its inode number.
I'm not sure what's the value of having a directory hard link given
the existence of symlinks. I undersatnd what the difference is, but
what value does it give to an end user? It's confusing, and if there
is a directory hard link to a directory, you won't be able to delete
the directory, lest you leave a dangling reference (and you can't just
remove the primary link to the directory, since then the ".." entry in
the directory will be pointing to the old parent directory). That
makes hard links of files fundamentally different from a directory
hard link, which will be even more confusing to users.
But if I were going to do such an insane thing, instead of trying to
do it by repurposing an inode field and using an inode, I'd probably
do it by using a bit in the file_type field of the directory entry to
indicate that it's this special "directory hard link" thing. This
doesn't solve the semantic questions of what happens if you want to
delete a directory that has one or more hard links to it, though.
Regards,
- Ted
next prev parent reply other threads:[~2014-04-15 22:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-15 13:43 [RFC][6/11][MANUX] Kernel compatibility : directory hardlinks Emmanuel Colbus
2014-04-15 20:06 ` Theodore Ts'o
2014-04-15 20:53 ` Emmanuel Colbus
2014-04-15 22:01 ` Theodore Ts'o [this message]
2014-04-15 23:12 ` Emmanuel Colbus
2014-04-15 23:34 ` Theodore Ts'o
2014-04-16 2:14 ` Emmanuel Colbus
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=20140415220119.GM4456@thunk.org \
--to=tytso@mit.edu \
--cc=ecolbus@manux.info \
--cc=linux-kernel@vger.kernel.org \
/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