Changeset View
Changeset View
Standalone View
Standalone View
head/sys/geom/mirror/g_mirror.c
Show First 20 Lines • Show All 976 Lines • ▼ Show 20 Lines | if (disk != NULL) { | ||||
} else { | } else { | ||||
G_MIRROR_LOGREQ(1, bp, | G_MIRROR_LOGREQ(1, bp, | ||||
"Request failed (error=%d).", | "Request failed (error=%d).", | ||||
bp->bio_error); | bp->bio_error); | ||||
} | } | ||||
if (g_mirror_disconnect_on_failure && | if (g_mirror_disconnect_on_failure && | ||||
g_mirror_ndisks(sc, G_MIRROR_DISK_STATE_ACTIVE) > 1) | g_mirror_ndisks(sc, G_MIRROR_DISK_STATE_ACTIVE) > 1) | ||||
{ | { | ||||
if (bp->bio_error == ENXIO && | |||||
bp->bio_cmd == BIO_READ) | |||||
sc->sc_bump_id |= G_MIRROR_BUMP_SYNCID; | |||||
else if (bp->bio_error == ENXIO) | |||||
sc->sc_bump_id |= G_MIRROR_BUMP_SYNCID_NOW; | |||||
else | |||||
sc->sc_bump_id |= G_MIRROR_BUMP_GENID; | sc->sc_bump_id |= G_MIRROR_BUMP_GENID; | ||||
g_mirror_event_send(disk, | g_mirror_event_send(disk, | ||||
G_MIRROR_DISK_STATE_DISCONNECTED, | G_MIRROR_DISK_STATE_DISCONNECTED, | ||||
G_MIRROR_EVENT_DONTWAIT); | G_MIRROR_EVENT_DONTWAIT); | ||||
} | } | ||||
} | } | ||||
switch (pbp->bio_cmd) { | switch (pbp->bio_cmd) { | ||||
case BIO_DELETE: | case BIO_DELETE: | ||||
case BIO_WRITE: | case BIO_WRITE: | ||||
▲ Show 20 Lines • Show All 1,518 Lines • ▼ Show 20 Lines | if (g_mirror_ndisks(sc, G_MIRROR_DISK_STATE_ACTIVE) == 0 && | ||||
} | } | ||||
} | } | ||||
/* | /* | ||||
* Genid should be bumped immediately, so do it here. | * Genid should be bumped immediately, so do it here. | ||||
*/ | */ | ||||
if ((sc->sc_bump_id & G_MIRROR_BUMP_GENID) != 0) { | if ((sc->sc_bump_id & G_MIRROR_BUMP_GENID) != 0) { | ||||
sc->sc_bump_id &= ~G_MIRROR_BUMP_GENID; | sc->sc_bump_id &= ~G_MIRROR_BUMP_GENID; | ||||
g_mirror_bump_genid(sc); | g_mirror_bump_genid(sc); | ||||
} | |||||
if ((sc->sc_bump_id & G_MIRROR_BUMP_SYNCID_NOW) != 0) { | |||||
sc->sc_bump_id &= ~G_MIRROR_BUMP_SYNCID_NOW; | |||||
g_mirror_bump_syncid(sc); | |||||
} | } | ||||
break; | break; | ||||
default: | default: | ||||
KASSERT(1 == 0, ("Wrong device state (%s, %s).", | KASSERT(1 == 0, ("Wrong device state (%s, %s).", | ||||
sc->sc_name, g_mirror_device_state2str(sc->sc_state))); | sc->sc_name, g_mirror_device_state2str(sc->sc_state))); | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 898 Lines • Show Last 20 Lines |