On Mon, Jun 25, 2018 at 11:24:50AM +0300, Nikolay Borisov wrote:
> Following the removal of the v0 handling code let's be courteous and
> print an error message when such extents are handled. In the cases
> where we have a transaction just abort it, otherwise just call
> btrfs_handle_fs_error. Both cases result in the FS being re-mounted RO.
> 
> Signed-off-by: Nikolay Borisov <[email protected]>
> ---
>  fs/btrfs/extent-tree.c | 44 ++++++++++++++++++++++++++++++++++++++++----
>  fs/btrfs/print-tree.c  | 11 ++++++++---
>  fs/btrfs/relocation.c  | 36 +++++++++++++++++++++++++++++++-----
>  3 files changed, 79 insertions(+), 12 deletions(-)
> 
> diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
> index 4129831523a2..131773528683 100644
> --- a/fs/btrfs/extent-tree.c
> +++ b/fs/btrfs/extent-tree.c
> @@ -870,8 +870,17 @@ int btrfs_lookup_extent_info(struct btrfs_trans_handle 
> *trans,
>                       num_refs = btrfs_extent_refs(leaf, ei);
>                       extent_flags = btrfs_extent_flags(leaf, ei);
>               } else {
> -                     BUG();
> +                     ret = -EINVAL;
> +                     btrfs_err(fs_info,
> +             "Unsupported V0 extent filesystem detected. Aborting. Please 
> re-create your filesystem with a newer kernel");

Can you please add a helper that prints the message so there aren't
several different copies of that? Also btrfs_err will add the last '\n',
so it's not needed.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to