Skip to content
  • Harald Freudenberger's avatar
    d39fae45
    s390/zcrypt: return EIO when msg retry limit reached · d39fae45
    Harald Freudenberger authored
    
    
    When a msg is retried because the lower ap layer returns -EAGAIN
    there is a retry limit (currently 10). When this limit is reached
    the last return code from the lower layer is returned, causing
    the userspace to get -1 on the ioctl with errno EAGAIN.
    
    This EAGAIN is misleading here. After 10 retry attempts the
    userspace should receive a clear failure indication like EINVAL
    or EIO or ENODEV. However, the reason why these retries all
    fail is unclear. On an invalid message EINVAL would be returned
    by the lower layer, and if devices go away or are not available
    an ENODEV is seen. So this patch now reworks the retry loops
    to return EIO to userspace when the retry limit is reached.
    
    Fixes: 91ffc519 ("s390/zcrypt: introduce msg tracking in zcrypt functions")
    Signed-off-by: default avatarHarald Freudenberger <freude@linux.ibm.com>
    Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
    d39fae45
    s390/zcrypt: return EIO when msg retry limit reached
    Harald Freudenberger authored
    
    
    When a msg is retried because the lower ap layer returns -EAGAIN
    there is a retry limit (currently 10). When this limit is reached
    the last return code from the lower layer is returned, causing
    the userspace to get -1 on the ioctl with errno EAGAIN.
    
    This EAGAIN is misleading here. After 10 retry attempts the
    userspace should receive a clear failure indication like EINVAL
    or EIO or ENODEV. However, the reason why these retries all
    fail is unclear. On an invalid message EINVAL would be returned
    by the lower layer, and if devices go away or are not available
    an ENODEV is seen. So this patch now reworks the retry loops
    to return EIO to userspace when the retry limit is reached.
    
    Fixes: 91ffc519 ("s390/zcrypt: introduce msg tracking in zcrypt functions")
    Signed-off-by: default avatarHarald Freudenberger <freude@linux.ibm.com>
    Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
Loading