Re: [PATCH 0/4 v2] add subvolume support to mkfs

2017-09-29 Thread David Sterba
On Wed, Aug 30, 2017 at 10:24:46AM -0700, Yingyi Luo wrote:
> From: yingyil 
> 
> Hi all,
> 
> Thanks for all the comments you gave to me. I really appriciate it. I've
> updated the patch, split it into small ones so that it may be easier
> for you to see the changes and review.
> 
> One use case of this feature is that it allows easier operations on 
> subvolumes,
> such as migrating subvolumes across images. With the current btrfs tool, we 
> have
> to do this manually by creating an empty subvolume then moving the files over.
> This feature which creates a subvolume for a given directory when making btrfs
> images simplifies the process and makes the logic cleaner.
> 
> Goffredo: Thanks again for you comments and pointing out the bug. It happened
> to be that I skipped the error code checking when I tested the functionality.
> The error came from a duplicate call of btrfs_make_root_dir() from
> make_root_dir() in mkfs/main.c and create_subvol() in convert/main.c.
> 
> strdup() is used to get a returnable copy of the literal string.
> FYI, parse_label() used strdup() to parse the input string. I think using
> strdup() would make it consistent with the current code.
> 
> Extending the feature would be a good idea. I'll try to work on it later.
> 
> Best regards,
> Yingyi
> 
> yingyil (4):
>   btrfs-progs: convert: move link_subvol out of main
>   btrfs-progs: add a parameter to btrfs_link_subvol
>   btrfs-progs: mkfs: refactor create_data_reloc_tree
>   btrfs-progs: mkfs: add subvolume support to mkfs

The updated patches have been added to devel. Before this will be
released, the propsed semantics of subvol/rootdir will have to be
implemented.

At the moment, overlaying files from rootdir over any previously created
subvolume does not work, there are probably missing checks for existing
dirs so this ends up with a duplicate entry.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/4 v2] add subvolume support to mkfs

2017-08-30 Thread Yingyi Luo
From: yingyil 

Hi all,

Thanks for all the comments you gave to me. I really appriciate it. I've
updated the patch, split it into small ones so that it may be easier
for you to see the changes and review.

One use case of this feature is that it allows easier operations on subvolumes,
such as migrating subvolumes across images. With the current btrfs tool, we have
to do this manually by creating an empty subvolume then moving the files over.
This feature which creates a subvolume for a given directory when making btrfs
images simplifies the process and makes the logic cleaner.

Goffredo: Thanks again for you comments and pointing out the bug. It happened
to be that I skipped the error code checking when I tested the functionality.
The error came from a duplicate call of btrfs_make_root_dir() from
make_root_dir() in mkfs/main.c and create_subvol() in convert/main.c.

strdup() is used to get a returnable copy of the literal string.
FYI, parse_label() used strdup() to parse the input string. I think using
strdup() would make it consistent with the current code.

Extending the feature would be a good idea. I'll try to work on it later.

Best regards,
Yingyi

yingyil (4):
  btrfs-progs: convert: move link_subvol out of main
  btrfs-progs: add a parameter to btrfs_link_subvol
  btrfs-progs: mkfs: refactor create_data_reloc_tree
  btrfs-progs: mkfs: add subvolume support to mkfs

 convert/main.c | 125 +--
 mkfs/main.c|  82 
 utils.c| 128 +
 utils.h|   3 ++
 4 files changed, 205 insertions(+), 133 deletions(-)

-- 
2.14.1.342.g6490525c54-goog

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html