From d9df4e1dc3b77167ee4b78064845fbd81632de9e Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Sat, 1 May 1999 06:09:04 +0000 Subject: 1999-05-01 Mark Kettenis * linux/dev/glue/block.c (device_get_status): Always set status_count to DEV_GET_STATUS_COUNT if flavor is DEV_GET_SIZE. --- linux/dev/glue/block.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'linux/dev/glue/block.c') diff --git a/linux/dev/glue/block.c b/linux/dev/glue/block.c index 9d6bd6d..7900e72 100644 --- a/linux/dev/glue/block.c +++ b/linux/dev/glue/block.c @@ -1595,8 +1595,6 @@ device_get_status (void *d, dev_flavor_t flavor, dev_status_t status, switch (flavor) { case DEV_GET_SIZE: - if (*status_count != DEV_GET_SIZE_COUNT) - return D_INVALID_SIZE; if (disk_major (MAJOR (bd->dev))) { assert (bd->ds->gd); @@ -1626,6 +1624,12 @@ device_get_status (void *d, dev_flavor_t flavor, dev_status_t status, the driver, but a lot of user level code assumes the sector size to be 512. */ status[DEV_GET_SIZE_RECORD_SIZE] = 512; + /* Always return DEV_GET_SIZE_COUNT. This is what all native + Mach drivers do, and makes it possible to detect the absence + of the call by setting it to a different value on input. MiG + makes sure that we will never return more integers than the + user asked for. */ + *status_count = DEV_GET_SIZE_COUNT; break; case V_GETPARMS: -- cgit v1.2.3