From: Theodore Ts'o <tytso@mit.edu>
To: Darren Hart <dvhart@infradead.org>
Cc: Andreas Dilger <aedilger@gmail.com>,
Andreas Dilger <adilger@dilger.ca>,
linux-ext4 <linux-ext4@vger.kernel.org>
Subject: Re: [e2fsprogs] initdir: Writing inode after the initial write?
Date: Tue, 4 Dec 2012 15:00:13 -0500 [thread overview]
Message-ID: <20121204200013.GD7790@thunk.org> (raw)
In-Reply-To: <50BE51BF.6020208@infradead.org>
On Tue, Dec 04, 2012 at 11:40:47AM -0800, Darren Hart wrote:
>
> 1) Update debugfs to completely support our use-case
> [ ] Add symlink support
> [ ] Add hardlink support
This exists already. See the "link" command. It doesn't update the
inode i_links_count, but that's probably something I would add by
adding an option (-i) which did this.
> [ ] Add meta-data mirroring
Not sure what what you mean by meta-data mirroring?
> 2) Refactor filesystem creation functions from debugfs and move them into
> libext2fs alongside existing filesystem creation functions like
> ext2fs_mkdir()
I'm not sure that creating new libext2fs functions is necessarily
needed. We'll need to discuss that on a case-by-case basis. For
creating a new symlink, sure, I'll buy that --- there's enough
complexity involved that it makes sense to move that into the library.
For creating a new hard link, we already have ext2fs_link(). Whether
or not it makes sense to add an entirely new function just to bump
i_links_count seems very dubious to me. We could add a flag which
reads in the target inode, bumps i_links_count, and then writes it
back out, but then we start asking whether or not we need to add an
option to set the ctime field or not, etc., etc., etc.
Taken to extremes that way lies the insanity of VMS's create_process
system call, with its huge number of parameters and options, as
opposed to separating fork() and exec(), and allowing the application
program to close file descriptors dup them, edit environment
variables, etc., between the fork() and exec(), which was a much saner
way of doing things in Unix.
So it's actually quite deliberate that what we have are very low-level
primitives in libext2fs. That being said, API design is a bit of an
art, as I said, for something as complicated as symlink creation,
where you need to do different things depending on whether the symlink
pathname can fit in the inode, etc., it does make sense to have a new
function.
> 3) Add the "-r initialdir" option to mke2fs that leverages these new
> functions
> from libext2fs.
Assuming the code for -r can be well constrained in terms of cleanly
added to the mke2fs sources (probably the bulk of the code should go
in a new .c file), and assuming that it doesn't bloat the mke2fs
binary too badly, I have no objections to adding the -r option to
mke2fs. (Worst case we can have a --disable-mke2fs-init-dir if there
are still people worried about making mke2fs fit on a boot/root 1.44M
floppy. :-)
That being said, if it bloats mke2fs too badly (for example, because
you tried using libxml2 for some kind of control file to specify the
character/block devices, and it dragged in megabytes and megabytes of
compiled object code, I'd certainly object, both because of the
addition of the external dependency, and because at that point people
really would complain --- and of course, because XML is just
horrible. :-)
- Ted
next prev parent reply other threads:[~2012-12-04 20:00 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-01 2:13 [e2fsprogs] initdir: Writing inode after the initial write? Darren Hart
2012-12-01 4:23 ` Andreas Dilger
2012-12-01 5:08 ` Darren Hart
2012-12-01 19:31 ` Andreas Dilger
2012-12-03 19:46 ` Darren Hart
2012-12-04 10:45 ` Yongqiang Yang
2012-12-04 17:42 ` Darren Hart
2012-12-04 10:59 ` Andreas Dilger
2012-12-04 17:43 ` Darren Hart
2012-12-04 19:08 ` Theodore Ts'o
2012-12-04 19:40 ` Darren Hart
2012-12-04 20:00 ` Theodore Ts'o [this message]
2012-12-04 20:10 ` Darren Hart
2012-12-04 20:36 ` Theodore Ts'o
2012-12-04 15:22 ` Theodore Ts'o
2012-12-04 17:46 ` Darren Hart
2012-12-04 19:24 ` Theodore Ts'o
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=20121204200013.GD7790@thunk.org \
--to=tytso@mit.edu \
--cc=adilger@dilger.ca \
--cc=aedilger@gmail.com \
--cc=dvhart@infradead.org \
--cc=linux-ext4@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