mbox series

[0/2] btrfs-progs: Auto resize fs after device replace

Message ID 20200307224516.16315-1-marcos@mpdesouza.com (mailing list archive)
Headers show
Series btrfs-progs: Auto resize fs after device replace | expand

Message

Marcos Paulo de Souza March 7, 2020, 10:45 p.m. UTC
From: Marcos Paulo de Souza <mpdesouza@suse.com>

These two patches make possible to resize the fs after a successful replace
finishes. The flag -a is responsible for doing it (-r is already use, so -a in
this context means "automatically").

The first patch just moves the resize rationale to utils.c and the second patch
adds the flag an calls resize if -a is informed replace finishes successfully.

Please review!

Marcos Paulo de Souza (2):
  btrfs-progs: Move resize into functionaly into utils.c
  btrfs-progs: replace: New argument to resize the fs after replace

 Documentation/btrfs-replace.asciidoc |  4 +-
 cmds/filesystem.c                    | 58 +--------------------------
 cmds/replace.c                       | 19 ++++++++-
 common/utils.c                       | 60 ++++++++++++++++++++++++++++
 common/utils.h                       |  1 +
 5 files changed, 83 insertions(+), 59 deletions(-)

Comments

Anand Jain March 8, 2020, 10:58 a.m. UTC | #1
On 3/8/20 6:45 AM, Marcos Paulo de Souza wrote:
> From: Marcos Paulo de Souza <mpdesouza@suse.com>
> 
> These two patches make possible to resize the fs after a successful replace
> finishes. The flag -a is responsible for doing it (-r is already use, so -a in
> this context means "automatically").

If resize fails we should be able to fail the replace as well which does
not happen here. I am thinking this should be kernel feature, do the
resize part before calling btrfs_dev_replace_finishing().

IMO, it makes sense that replace and resize be in one command as
proposed in this patch. We had similar discussion whether to combine
replace and resize of missing device here:
    https://patchwork.kernel.org/patch/11249009/

-Anand

> The first patch just moves the resize rationale to utils.c and the second patch
> adds the flag an calls resize if -a is informed replace finishes successfully.
> 
> Please review!
> 
> Marcos Paulo de Souza (2):
>    btrfs-progs: Move resize into functionaly into utils.c
>    btrfs-progs: replace: New argument to resize the fs after replace
> 
>   Documentation/btrfs-replace.asciidoc |  4 +-
>   cmds/filesystem.c                    | 58 +--------------------------
>   cmds/replace.c                       | 19 ++++++++-
>   common/utils.c                       | 60 ++++++++++++++++++++++++++++
>   common/utils.h                       |  1 +
>   5 files changed, 83 insertions(+), 59 deletions(-)
>