Bug 13729

Summary: write() to a disk device returns success although kernel function has failed
Product: glibc Reporter: Vic <redhat>
Component: libcAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED INVALID    
Severity: critical CC: drepper.fsp, redhat
Priority: P2 Flags: fweimer: security-
Version: 2.11   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:

Description Vic 2012-02-23 15:57:05 UTC
This code line

if ( write(fd,buf,sectsize*i) != (sectsize*i) ) error(1,errno,"fill_blocks write failed");

never throws an error, although nothing gets written to the disk.

The Linux kernel knows the problem. It just doesn't get reported through to my user space program.

Syslog excerpt:
Feb 22 18:55:29 linux-xyf6 kernel: [   99.981245] sd 1:0:0:0: [sdb] Unhandled error code
Feb 22 18:55:29 linux-xyf6 kernel: [   99.981248] sd 1:0:0:0: [sdb]  Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
Feb 22 18:55:29 linux-xyf6 kernel: [   99.981251] sd 1:0:0:0: [sdb] CDB: Write(10): 2a 00 00 38 8a 30 00 01 00 00
Feb 22 18:55:29 linux-xyf6 kernel: [   99.981258] end_request: I/O error, dev sdb, sector 3705392
Comment 1 Andreas Schwab 2012-02-23 16:01:01 UTC
This is a kernel issue.