]> git.baikalelectronics.ru Git - kernel.git/commit
NBD: allow hung network I/O to be cancelled
authorPaul Clements <paul.clements@steeleye.com>
Wed, 17 Oct 2007 06:27:37 +0000 (23:27 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Wed, 17 Oct 2007 15:42:55 +0000 (08:42 -0700)
commitd5dd39d0a24fd13cdac0eca270d3ed78fc86370d
treee2423a0338bf5d48f24bca1091e3069508f45f01
parente7c1d2b3e8fd6439a6b996b78af44185406c63ff
NBD: allow hung network I/O to be cancelled

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: Paul Clements <paul.clements@steeleye.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/block/nbd.c
include/linux/nbd.h