Commit 2635120e authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] cciss: return -ENXIO on no-device-present

From: mike.miller@hp.com

If no device is attached we now return -ENXIO instead of some bogus
numbers.  Prevents applications from trying to access non-existent disks.
Also adds HDIO_GETGEO_BIG IOCTL that fdisk uses.
parent bcb10ca8
......@@ -469,11 +469,8 @@ static int cciss_ioctl(struct inode *inode, struct file *filep,
driver_geo.heads = drv->heads;
driver_geo.sectors = drv->sectors;
driver_geo.cylinders = drv->cylinders;
} else {
driver_geo.heads = 0xff;
driver_geo.sectors = 0x3f;
driver_geo.cylinders = (int)drv->nr_blocks / (0xff*0x3f);
}
} else
return -ENXIO;
driver_geo.start= get_start_sect(inode->i_bdev);
if (copy_to_user((void *) arg, &driver_geo,
sizeof( struct hd_geometry)))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment