Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: strange ld(4) behavior when reading off end of disk

gdt%lexort.com@localhost (Greg Troxel) writes:

>When I try to read from the  suspect address I get normal behavior:

>  $ dd if=3D/dev/rld0c of=3D/dev/null iseek=3D62333948=20
>  4+0 records in
>  4+0 records out
>  2048 bytes transferred in 0.004 secs (512000 bytes/sec)

>My c partition size is 62333952, so it seems ok.

Try to do the same but read with a larger block size.

>Is there some missing bounds checking in ld, perhaps?
>Am I confused?
>Other ideas?

The SD card seem to fail an MMC_READ_BLOCK_MULTIPLE command for
the last device block. The command basically starts reading
sequentially and is stopped by a MMC_STOP_TRANSMISSION command
(that might be issued automatically by the controller). This edge
case seems to have a problem somewhere.

If you do 512 byte I/O the MMC_READ_BLOCK_SINGLE command is used
and you don't get an error when reading the last block.

N.B. there is a bad boundary check in sdmmc too, but it has no effect
since ld(4) does a correct boundary check and here we get the error
just before the boundary is exceeded.

                                Michael van Elst
Internet: mlelstv%serpens.de@localhost
                                "A potential Snark may lurk in every tree."

Home | Main Index | Thread Index | Old Index