stabd/geli: Bail out if you can't get the disks size
If the DIOCGMEDIASIZE ioctl fails, assume the disk doesn't have geli encryption. While all disks should implement this, fail safe for disks / partitions that do not. Sponsored by: Netflix
This commit is contained in:
parent
243a0eda9a
commit
787df454c8
@ -302,7 +302,8 @@ geli_probe_and_attach(struct open_file *f)
|
|||||||
hdesc = (struct disk_devdesc *)(f->f_devdata);
|
hdesc = (struct disk_devdesc *)(f->f_devdata);
|
||||||
|
|
||||||
/* Get the last block number for the host provider. */
|
/* Get the last block number for the host provider. */
|
||||||
hdesc->dd.d_dev->dv_ioctl(f, DIOCGMEDIASIZE, &hmediasize);
|
if (hdesc->dd.d_dev->dv_ioctl(f, DIOCGMEDIASIZE, &hmediasize) != 0)
|
||||||
|
return;
|
||||||
hlastblk = (hmediasize / DEV_BSIZE) - 1;
|
hlastblk = (hmediasize / DEV_BSIZE) - 1;
|
||||||
|
|
||||||
/* Taste the host provider. If it's not geli-encrypted just return. */
|
/* Taste the host provider. If it's not geli-encrypted just return. */
|
||||||
|
Loading…
Reference in New Issue
Block a user