mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-17 13:53:39 +00:00
Fix panic which occurs when given sector size for memory-backed device
is less than DEV_BSIZE (512) bytes. Reported by: Mike Bristow <mike@urgle.com> Approved by: phk
This commit is contained in:
parent
826569ce35
commit
6a40892929
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=129379
|
@ -805,8 +805,7 @@ mdcreate_malloc(struct md_ioctl *mdio)
|
|||
sc->fwsectors = mdio->md_fwsectors;
|
||||
if (mdio->md_fwheads != 0)
|
||||
sc->fwheads = mdio->md_fwheads;
|
||||
sc->nsect = mdio->md_size;
|
||||
sc->nsect /= (sc->secsize / DEV_BSIZE);
|
||||
sc->nsect = (mdio->md_size * DEV_BSIZE) / sc->secsize;
|
||||
sc->flags = mdio->md_options & (MD_COMPRESS | MD_FORCE);
|
||||
sc->indir = dimension(sc->nsect);
|
||||
sc->uma = uma_zcreate(sc->name, sc->secsize,
|
||||
|
|
Loading…
Reference in a new issue