From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: linux-btrfs@vger.kernel.org
Cc: dsterba@suse.cz
Subject: [PATCH 0/5] Mkfs: Rework --rootdir to a more generic behavior
Date: Mon, 4 Sep 2017 15:41:05 +0900 [thread overview]
Message-ID: <20170904064110.25951-1-quwenruo.btrfs@gmx.com> (raw)
mkfs.btrfs --rootdir provides user a method to generate btrfs with
pre-written content while without the need of root privilege.
However the code is quite old and doesn't get much review or test.
This makes some strange behavior, from customized chunk allocation
(which uses the reserved 0~1M device space) to lack of special file
handler (Fixed in previous 2 patches).
The reworked --rootdir will be based on traditional mkfs, everything is
processed after traditional mkfs, so nothing is customized.
The result will be an equivalent of mkfs, mount, cp, umount.
(If btrfs-progs chunk/extent allocator acts as the same as kernel)
And, add extra explanation for --rootdir, since the old implement
introduced a confusing behavior to limit the filesystem size.
The 1st patch fixes a bug that causes any write after
cleanup_temp_chunks() to trigger a NULL pointer dereference.
The 2nd patch changes the work flow of --rootdir, and slightly changed
the behavior, which will not shrink filesystem size by its own.
The 3rd patch will shrink the fs, to keep the behavior the same as old
--rootdir.
If anyone doesn't like the behavior, it can be removed easily.
(Which is the main part of the new code, I'd like to get rid of this)
The 4th patch enhance the verbose output to reflect the real chunk
allocation of --rootdir.
The final patch add extra documentary explanation.
Qu Wenruo (5):
btrfs-progs: Fix one-byte overlap bug in free_block_group_cache
btrfs-progs: mkfs: Rework rootdir option to avoid custom chunk layout
btrfs-progs: mkfs: Shrink the image for rootdir to minimal size
btrfs-progs: mkfs: Update allocation info before verbose output
btrfs-progs: Doc/mkfs: Add explanation for rootdir parameter
Documentation/mkfs.btrfs.asciidoc | 3 +
extent-tree.c | 2 +-
mkfs/main.c | 342 ++++++++++++++++++--------------------
3 files changed, 164 insertions(+), 183 deletions(-)
--
2.14.1
next reply other threads:[~2017-09-04 6:41 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-04 6:41 Qu Wenruo [this message]
2017-09-04 6:41 ` [PATCH 1/5] btrfs-progs: Fix one-byte overlap bug in free_block_group_cache Qu Wenruo
2017-09-04 6:41 ` [PATCH 2/5] btrfs-progs: mkfs: Rework rootdir option to avoid custom chunk layout Qu Wenruo
2017-09-04 6:41 ` [PATCH 3/5] btrfs-progs: mkfs: Shrink the image for rootdir to minimal size Qu Wenruo
2017-09-04 6:41 ` [PATCH 4/5] btrfs-progs: mkfs: Update allocation info before verbose output Qu Wenruo
2017-09-04 6:41 ` [PATCH 5/5] btrfs-progs: Doc/mkfs: Add explanation for rootdir parameter Qu Wenruo
2017-09-04 10:47 ` Duncan
2017-09-04 18:08 ` [PATCH 0/5] Mkfs: Rework --rootdir to a more generic behavior David Sterba
2017-09-05 8:19 ` Qu Wenruo
2017-09-05 19:05 ` Goffredo Baroncelli
2017-09-06 3:20 ` Qu Wenruo
2017-09-06 18:44 ` Goffredo Baroncelli
2017-09-06 11:31 ` Austin S. Hemmelgarn
2017-09-06 16:43 ` Goffredo Baroncelli
2017-09-06 17:16 ` Austin S. Hemmelgarn
2017-09-06 17:48 ` Goffredo Baroncelli
2017-09-06 18:02 ` Austin S. Hemmelgarn
2017-09-06 18:31 ` Goffredo Baroncelli
2017-09-06 18:46 ` Austin S. Hemmelgarn
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=20170904064110.25951-1-quwenruo.btrfs@gmx.com \
--to=quwenruo.btrfs@gmx.com \
--cc=dsterba@suse.cz \
--cc=linux-btrfs@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;
as well as URLs for NNTP newsgroup(s).