1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-25 11:37:56 +00:00

Don't treat an error from g_mirror_clear_metadata() as fatal.

Such errors can occur as the result of a write error or because the disk
backing the mirror element was removed. They result in a generation ID bump
on all active elements of the mirror, so we can safely disconnect the mirror
component rather than destroy it.

MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D7750
This commit is contained in:
Mark Johnston 2016-09-06 23:42:59 +00:00
parent 40c5032d32
commit 4bfb585351
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=305509

View File

@ -2678,8 +2678,12 @@ g_mirror_update_disk(struct g_mirror_disk *disk, u_int state)
int error;
error = g_mirror_clear_metadata(disk);
if (error != 0)
return (error);
if (error != 0) {
G_MIRROR_DEBUG(0,
"Device %s: failed to clear metadata on %s: %d.",
sc->sc_name, g_mirror_get_diskname(disk), error);
break;
}
DISK_STATE_CHANGED();
G_MIRROR_DEBUG(0, "Device %s: provider %s destroyed.",
sc->sc_name, g_mirror_get_diskname(disk));