On 3/8/20 6:45 AM, Marcos Paulo de Souza wrote:
From: Marcos Paulo de Souza <mpdesouza@xxxxxxxx> 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(-)
