• Paul Clements's avatar
    NBD: allow hung network I/O to be cancelled · 7fdfd406
    Paul Clements authored
    Allow NBD I/O to be cancelled when a network outage occurs.  Previously, I/O
    would just hang, and if enough I/O was hung in nbd, the system (at least
    user-level) would completely hang until a TCP timeout (default, 15 minutes)
    occurred.
    
    The patch introduces a new ioctl NBD_SET_TIMEOUT that allows a transmit
    timeout value (in seconds) to be specified.  Any network send that exceeds the
    timeout will be cancelled and the nbd connection will be shut down.  I've
    tested with various timeout values and 6 seconds seems to be a good choice for
    the timeout.  If the NBD_SET_TIMEOUT ioctl is not called, you get the old (I/O
    hang) behavior.
    Signed-off-by: default avatarPaul Clements <paul.clements@steeleye.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    7fdfd406
nbd.c 18 KB