Correct logic error in biosdisk.c:bd_realstrategy()
The wrong condition is used when evaluating the return of disk_ioctl() This results in reaching the 'We should not get here' branch in most casts Reviewed by: imp Sponsored by: Klara Systems Differential Revision: https://reviews.freebsd.org/D15839
This commit is contained in:
parent
4e3db1e0af
commit
86981e426d
@ -594,8 +594,8 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, size_t size,
|
||||
*rsize = 0;
|
||||
|
||||
/* Get disk blocks, this value is either for whole disk or for partition */
|
||||
if (disk_ioctl(dev, DIOCGMEDIASIZE, &disk_blocks)) {
|
||||
/* DIOCGMEDIASIZE does return bytes. */
|
||||
if (disk_ioctl(dev, DIOCGMEDIASIZE, &disk_blocks) == 0) {
|
||||
/* DIOCGMEDIASIZE returns bytes. */
|
||||
disk_blocks /= BD(dev).bd_sectorsize;
|
||||
} else {
|
||||
/* We should not get here. Just try to survive. */
|
||||
|
Loading…
x
Reference in New Issue
Block a user