Get blockdev size right in pktcdvd after switching discs
PATCH 1/1 Get blockdev size right in pktcdvd after switching discs
If you do "pktsetup 0 /dev/hdd", insert a CD and write some data to it, remove the CD and insert a DVD, the /dev/hdd block device will not have the correct size. This leads to bogus "attempt to access beyond end of device" errors.
This patch fixes it.
Signed-off-by Peter Osterlund <[email protected]>
---
linux-petero/drivers/block/pktcdvd.c | 2 ++ 1 files changed, 2 insertions(+)
drivers/block/pktcdvd.c renamed from drivers/block/pktcdvd.c~packet-capacity +2 -0
@@ -1971,6 +1971,8 @@ static int pkt_open_dev(struct pktcdvd_d }set_capacity (pd->disk, lba <<2 ); +set_capacity (pd->bdev->bd_disk, lba <<2 ); +bd_set_size (pd->bdev, (loff_t )lba <<11 );/* * The underlying block device needs to have its merge logic
_
Signature · 2 lines
Peter Osterlund - [email protected] http://w1.894.telia.com/~u89404340