Finn Thain 5a13388d7a block/swim: Fix IO error at end of medium
Reading to the end of a 720K disk results in an IO error instead of EOF
because the block layer thinks the disk has 2880 sectors. (Partly this
is a result of inverted logic of the ONEMEG_MEDIA bit that's now fixed.)

Initialize the density and head count in swim_add_floppy() to agree
with the device size passed to set_capacity() during drive probe.

Call set_capacity() again upon device open, after refreshing the density
and head count values.

Cc: Laurent Vivier <lvivier@redhat.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: stable@vger.kernel.org # v4.14+
Tested-by: Stan Johnson <userm57@yahoo.com>
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Acked-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2018-04-16 21:49:35 -06:00
..
2018-01-17 08:41:07 -07:00
2018-02-06 09:59:40 -08:00
2018-04-14 22:34:27 -06:00
2018-04-14 22:34:27 -06:00
2018-03-01 08:41:27 -07:00
2017-02-20 12:16:15 +01:00
2018-04-10 12:25:30 -07:00
2017-08-18 08:45:29 -06:00
2018-04-05 14:27:02 -07:00