On 2018年04月03日 16:39, Su Yue wrote:
> when mkfs.btrfs on a thin provision device which has very small
> backing size and big virtual size, all code works well in
> mkfs.btrfs until close_ctree() is called.
> close_ctree() fails to sync device due to small backing size
> while closing devices.
> However, mkfs returns 0 in such situation which causes failure of
> xfstests generic/405.
>
> So, let mkfs returns nonzero value if previous steps succeeded but
> close_ctree() failed.
> Then xfstests generic/405 passes now.
>
> Signed-off-by: Su Yue <suy.fnst@xxxxxxxxxxxxxx>
Reviewed-by: Qu Wenruo <wqu@xxxxxxxx>
Thanks,
Qu
> ---
> mkfs/main.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/mkfs/main.c b/mkfs/main.c
> index 5a717f701cd5..9f7f2396df8f 100644
> --- a/mkfs/main.c
> +++ b/mkfs/main.c
> @@ -1285,6 +1285,12 @@ out:
> }
> }
>
> + if (!ret && close_ret) {
> + ret = close_ret;
> + error("failed to close ctree, the filesystem may be inconsistent: %d",
> + ret);
> + }
> +
> btrfs_close_all_devices();
> free(label);
>
>
Attachment:
signature.asc
Description: OpenPGP digital signature
