loader: geli_dev_ioctl does return huge mediasize
The DIOCGMEDIASIZE is calculated md->md_sectorsize * md->md_provsize, and for boot disk, the md_sectorsize is 4k. However, the md_provsize is already in units of bytes. Sponsored by: Netflix, Klara Inc.
This commit is contained in:
parent
c201ce0b4a
commit
0d1a620681
@ -219,7 +219,7 @@ geli_dev_ioctl(struct open_file *f, u_long cmd, void *data)
|
|||||||
*(u_int *)data = md->md_sectorsize;
|
*(u_int *)data = md->md_sectorsize;
|
||||||
break;
|
break;
|
||||||
case DIOCGMEDIASIZE:
|
case DIOCGMEDIASIZE:
|
||||||
*(uint64_t *)data = md->md_sectorsize * md->md_provsize;
|
*(uint64_t *)data = md->md_provsize;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return (ENOTTY);
|
return (ENOTTY);
|
||||||
|
Loading…
Reference in New Issue
Block a user