1. 05 Feb, 2016 3 commits
    • Markus Pargmann's avatar
      nbd: Cleanup reset of nbd and bdev after a disconnect · 0e4f0f6f
      Markus Pargmann authored
      Group all variables that are reset after a disconnect into reset
      functions. This patch adds two of these functions, nbd_reset() and
      nbd_bdev_reset().
      Signed-off-by: default avatarMarkus Pargmann <mpa@pengutronix.de>
      0e4f0f6f
    • Markus Pargmann's avatar
      nbd: Timeouts are not user requested disconnects · 1f7b5cf1
      Markus Pargmann authored
      It may be useful to know in the client that a connection timed out. The
      current code returns success for a timeout.
      
      This patch reports the error code -ETIMEDOUT for a timeout.
      Signed-off-by: default avatarMarkus Pargmann <mpa@pengutronix.de>
      1f7b5cf1
    • Markus Pargmann's avatar
      nbd: Remove signal usage · 23272a67
      Markus Pargmann authored
      As discussed on the mailing list, the usage of signals for timeout
      handling has a lot of potential issues. The nbd driver used for some
      time signals for timeouts. These signals where able to get the threads
      out of the blocking socket operations.
      
      This patch removes all signal usage and uses a socket shutdown instead.
      The socket descriptor itself is cleared later when the whole nbd device
      is closed.
      
      The tasks_lock is removed as we do not depend on this anymore. Instead
      a new lock for the socket is introduced so we can safely work with the
      socket in the timeout handler outside of the two main threads.
      
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Signed-off-by: default avatarMarkus Pargmann <mpa@pengutronix.de>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      23272a67
  2. 03 Feb, 2016 1 commit
    • Markus Pargmann's avatar
      nbd: Fix debugfs error handling · 27ea43fe
      Markus Pargmann authored
      Static checker complains about the implemented error handling. It is
      indeed wrong. We don't care about the return values of created debugfs
      files.
      
      We only have to check the return values of created dirs for NULL
      pointer. If we use a null pointer as parent directory for files, this
      may lead to debugfs files in wrong places.
      Signed-off-by: default avatarMarkus Pargmann <mpa@pengutronix.de>
      27ea43fe
  3. 24 Jan, 2016 36 commits