Bug 196086 - [geom] a race in gmirror cause kernel crash during startup
Summary: [geom] a race in gmirror cause kernel crash during startup
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 9.3-RELEASE
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-geom (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-18 08:52 UTC by alexandre.martins
Modified: 2015-03-07 15:22 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description alexandre.martins 2014-12-18 08:52:10 UTC
In the function g_mirror_add_disk, the event "G_MIRROR_DISK_STATE_NEW" is sent before the call to g_mirror_update_metadata.

However, if the event finishes before the call to g_mirror_update_metadata, with the result that the disk is destroy, the "disk" pointer is now invalid and may cause a kernel crash.


In my case, the disk was invalid because its syncid was not updated ("Component ada1 (device gm0) broken, skipping." in function g_mirror_update_device)


The solution may be to call g_mirror_update_metadata before the launch of the event G_MIRROR_DISK_STATE_NEW.