Re: Reading DVD w/ pktcdvd module loaded causes 4GB access errors
Hello, I've been puzzling about why I was getting CDROM read errors; now I realize what is going on. If you execute the pktsetup program with no disk in the drive, it marks the block device as "open", and some code in the file system layer (in block_dev.c) tries to discover the capacity of the drive. With no disk in the drive, this defaults to 1FFFFF blocks (this is hardcoded in ide-cd.c). If you then mount a disk and try to read it, the code in block_dev.c does not reset the disk capacity because it has got the device marked as "already open". The following patch to block_dev.c fixes this behaviour by resetting the disk size every time the device is opened. I'm sure this is the wrong way to fix it, but it works for me as a quick-and-dirty workaround. BTW this is a patch to 2.6.10 but I can't see why it shouldn't work with 2.6.8. --- linux/fs/block_dev.c.orig 2004-12-25 08:26:10.000000000 +0000 +++ linux/fs/block_dev.c 2004-12-31 17:24:12.000000000 +0000 @@ -630,6 +630,7 @@ if (ret) goto out; } + bd_set_size(bdev,(loff_t)get_capacity(disk)<<9); if (bdev->bd_invalidated) rescan_partitions(bdev->bd_disk, bdev); } else { Regards, John
participants (1)
-
john