In function zvol_create_minor_impl(), the TargetId and Lun is created for zvol before it is fully setup/initialized.
zvol_create_minor_impl(const char *name)
{
...
// Assign new TargetId and Lun
(1) wzvol_assign_targetid(zv);
...
...
// This method setup additional zvol state like zv_volsize etc. So zvol state is not complete till this method.
(2) error = zvol_open_impl(zv, FWRITE, 0, NULL);
can the targetId and Lun be assigned here?
//wzvol_assign_targetid(zv);
}
I understand that StorPortNotification(BusChangeDetected) is called after this method returns. But if suppose for some reason (say disk rescan), SCSIOP_REPORT_LUNS request is received in between 1 & 2 then ScsiOpReportLuns() would also report this partially initialized zvol?
In function zvol_create_minor_impl(), the TargetId and Lun is created for zvol before it is fully setup/initialized.
zvol_create_minor_impl(const char *name) { ... // Assign new TargetId and Lun (1) wzvol_assign_targetid(zv); ... ... // This method setup additional zvol state like zv_volsize etc. So zvol state is not complete till this method. (2) error = zvol_open_impl(zv, FWRITE, 0, NULL);
}
I understand that StorPortNotification(BusChangeDetected) is called after this method returns. But if suppose for some reason (say disk rescan), SCSIOP_REPORT_LUNS request is received in between 1 & 2 then ScsiOpReportLuns() would also report this partially initialized zvol?