• Tejun Heo's avatar
    block: fix SG_IO vector request data length handling · 25636e28
    Tejun Heo authored
    Impact: fix SG_IO behavior such that it matches the documentation
    
    SG_IO howto says that if ->dxfer_len and sum of iovec disagress, the
    shorter one wins.  However, the current implementation returns -EINVAL
    for such cases.  Trim iovc if it's longer than ->dxfer_len.
    
    This patch uses iov_*() helpers which take struct iovec * by casting
    struct sg_iovec * to it.  sg_iovec is always identical to iovec and
    this will be further cleaned up with later patches.
    Signed-off-by: default avatarTejun Heo <tj@kernel.org>
    Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
    25636e28
scsi_ioctl.c 17.2 KB