[Bug 91149] fix man page: read(2) and write(2) can return EINVAL for unaligned access to block devices

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sat Aug 26 10:44:52 UTC 2017


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=91149

Matthias Andree <mandree at FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|read(2) can return EINVAL   |fix man page: read(2) and
                   |for unaligned access to     |write(2) can return EINVAL
                   |block devices               |for unaligned access to
                   |                            |block devices
                 CC|                            |mandree at FreeBSD.org

--- Comment #1 from Matthias Andree <mandree at FreeBSD.org> ---
This should also be added to write(2); I have recently received a truss report
from FreeBSD 12 running e2fsck that showed this fragment:

lseek(4,0x430,SEEK_SET)                 = 1072 (0x430)
write(4,"\^F0\M-!Y\0\0",6)             ERR#22 'Invalid argument'

where fd 4 is /dev/da0s1, an external 2015 Western Digital My Passport Ultra
USB hard disk of 1 TB with this diskinfo (identifying information removed):

# diskinfo -v /dev/da0
/dev/da0
        512             # sectorsize
        1000170586112   # mediasize in bytes (931G)
        1953458176      # mediasize in sectors
        4096            # stripesize
        0               # stripeoffset
        121597          # Cylinders according to firmware.
        255             # Heads according to firmware.
        63              # Sectors according to firmware.
        WD My Passport 0830     # Disk descr.
        [REMOVED]       # Disk ident.
        Not_Zoned       # Zone Mode

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-doc mailing list