linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] Mkfs: Rework --rootdir to a more generic behavior
@ 2017-09-04  6:41 Qu Wenruo
  2017-09-04  6:41 ` [PATCH 1/5] btrfs-progs: Fix one-byte overlap bug in free_block_group_cache Qu Wenruo
                   ` (5 more replies)
  0 siblings, 6 replies; 19+ messages in thread
From: Qu Wenruo @ 2017-09-04  6:41 UTC (permalink / raw)
  To: linux-btrfs; +Cc: dsterba

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


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2017-09-06 18:46 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-04  6:41 [PATCH 0/5] Mkfs: Rework --rootdir to a more generic behavior Qu Wenruo
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

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).