Port-arm archive

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

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



I have a RPI3 with a 32G uSD, running netbsd-9.  It's pretty normal.  On
all of my machines, I run dd from the disk to /dev/null, usually bs=1m,
every couple of months, to proactively find disk trouble.

On one machine I ran "dd if=/dev/ld0c of=/dev/null bs=1m".
I got an I/O error indication form dd, and in dmesg (boot, and just now):

[     1.708641] ld0 at sdmmc0: <0x03:0x5344:SL32G:0x80:0x241f2b31:0x118>
[     1.718247] ld0: 30436 MB, 7729 cyl, 128 head, 63 sec, 512 bytes/sect x 62333952 sectors
[     1.728247] ld0: 4-bit width, High-Speed/SDR25, 50.000 MHz
[     6.831184] boot device: ld0
[     6.841186] root on ld0a dumps on ld0b

[ 1367984.030787] ld0c: error reading fsbn 62333948 of 62333948-62333951 (ld0 bn 62333948; cn 30436 tn 31 sn 28), retrying
[ 1367984.850821] ld0c: error reading fsbn 62333948 of 62333948-62333951 (ld0 bn 62333948; cn 30436 tn 31 sn 28), retrying
[ 1367985.670855] ld0c: error reading fsbn 62333948 of 62333948-62333951 (ld0 bn 62333948; cn 30436 tn 31 sn 28), retrying
[ 1367986.490890] ld0c: error reading fsbn 62333948 of 62333948-62333951 (ld0 bn 62333948; cn 30436 tn 31 sn 28), retrying
[ 1367987.310922] ld0c: error reading fsbn 62333948 of 62333948-62333951 (ld0 bn 62333948; cn 30436 tn 31 sn 28), retrying
[ 1367988.130956] ld0c: error reading fsbn 62333948 of 62333948-62333951 (ld0 bn 62333948; cn 30436 tn 31 sn 28)

I realize I'm going to get a short read, but I expect a short read, not
an error to dd, and not an error in the kernel.

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

  $ dd if=/dev/rld0c of=/dev/null iseek=62333948 
  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.

The machine is otherwise ok.


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

Attachment: signature.asc
Description: PGP signature



Home | Main Index | Thread Index | Old Index