In virstor_ctl_stop(), check for a valid softc before trying to update

metadata.

Sponsored by:		Intel
Reported and tested by:	Marcelo Gondim <gondim at bsdinfo dot com dot br>
PR:			kern/170199
MFC after:		3 days
This commit is contained in:
Jim Harris 2012-08-03 20:24:16 +00:00
parent 0046805a58
commit c1d00eabe8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=239021

View File

@ -235,6 +235,12 @@ virstor_ctl_stop(struct gctl_req *req, struct g_class *cp)
return;
}
sc = virstor_find_geom(cp, name);
if (sc == NULL) {
gctl_error(req, "Don't know anything about '%s'", name);
g_topology_unlock();
return;
}
LOG_MSG(LVL_INFO, "Stopping %s by the userland command",
sc->geom->name);
update_metadata(sc);