Re: [PATCH RFC md-6.16 v3 05/19] md: delay registration of bitmap_ops until creating bitmap

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




.






[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux