Translated message

A translation of this page exists in English.

RAW デバイスにアクセスすると read 呼び出しで EIO が発生する

Solution Unverified - Updated -

Issue

  • read 呼び出しで RAW デバイスにアクセスする際に、指定したサイズを読み込むことができないと EIO (入力/出力エラー) が発生します。この RAW デバイスの動作はカーネルバージョンによって変わります。
  • EIO は、kernel-2.6.32-358.23.2.el6 では発生しませんが、kernel-2.6.32-431.el6 の RAW デバイスで発生します。

  • 2.6.32-431.el6 の strace 内で read 呼び出しを 3 回完了します。4 回目の呼び出しで EIO が発生します。

# strace -f dd if=/dev/raw/raw1 of=/dev/null bs=1M
...
mmap(NULL, 1060864, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f54bb2db000
read(0, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1048576) = 1048576
write(1, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1048576) = 1048576
read(0, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1048576) = 1048576
write(1, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1048576) = 1048576
read(0, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1048576) = 1048576
write(1, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1048576) = 1048576
read(0, 0x7f54bb2dc000, 1048576)  = -1 EIO (Input/output error)
  • 2.6.32-358.23.2.el6 の strace 内で read 呼び出しを 4 回完了します。
# strace -f dd if=/dev/raw/raw1 of=/dev/null bs=1M
...
mmap(NULL, 1060864, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f8fac61c000
read(0, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1048576) = 1048576
write(1, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1048576) = 1048576
read(0, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1048576) = 1048576
write(1, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1048576) = 1048576
read(0, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1048576) = 1048576
write(1, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1048576) = 1048576
read(0, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1048576) = 980992
write(1, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 980992) = 980992
read(0, "", 1048576)              = 0
  • RHEL6.5 カーネルを使用するとデバイスの終わりに RAW デバイスの読み取りに失敗しますが、以前のカーネルでは問題なく成功します。
 -- 2.6.32-431.el6 --
 # dd if=/dev/raw/raw1 of=/dev/null bs=1M
 dd: reading `/dev/raw/raw1':Input/output error
 3+0 records in
 3+0 records out
 3145728 bytes (3.1 MB) copied, 0.0102012 s, 308 MB/s

 -- 2.6.32-358.23.2.el6 --
 # dd if=/dev/raw/raw1 of=/dev/null bs=1M
 3+1 records in
 3+1 records out
 4126720 bytes (4.1 MB) copied, 0.124816 s, 33.1 MB/s

Environment

  • Red Hat Enterprise Linux 6.5
  • kernel-2.6.32-431.el6.x86_64
  • RAW デバイス

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content