Hi,

在 2025/05/12 12:53, Christoph Hellwig 写道:
+       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?

The caller check and return -ENOENT if mddev->bitmap_ops is NULL, I
can change the code here by checking return value instead.

Thanks,
Kuai




.



Reply via email to