> +     head = xa_load(&md_submodule, mddev->bitmap_id);
>       xa_unlock(&md_submodule);
> -     if (!mddev->bitmap_ops)
> -             pr_warn_once("md: can't find bitmap id %d\n", mddev->bitmap_id);
> +
> +     if (WARN_ON_ONCE(!head || head->type != MD_BITMAP)) {
> +             pr_err("md: can't find bitmap id %d\n", mddev->bitmap_id);
> +             return;
> +     }

This needs a real error return, doesn't it?


Reply via email to