1. 22 Aug, 2011 1 commit
    • Joe Jin's avatar
      xen-blkback: Don't disconnect backend until state switched to XenbusStateClosed. · 6f5986bc
      Joe Jin authored
      When do block-attach/block-detach test with below steps, umount hangs
      in the guest. Furthermore shutdown ends up being stuck when umounting file-systems.
      
      1. start guest.
      2. attach new block device by xm block-attach in Dom0.
      3. mount new disk in guest.
      4. execute xm block-detach to detach the block device in dom0 until timeout
      5. Any request to the disk will hung.
      
      Root cause:
      This issue is caused when setting backend device's state to
      'XenbusStateClosing', which sends to the frontend the XenbusStateClosing
      notification. When frontend receives the notification it tries to release
      the disk in blkfront_closing(), but at that moment the disk is still in use
      by guest, so frontend refuses to close. Specifically it sets the disk state to
      XenbusStateClosing and sends the notification to backend - when backend receives the
      event, it disconnects the vbd from real device, and sets the vbd device state to
      XenbusStateClosing. The backend disconnects the real device/file, and any IO
      requests to the disk in guest will end up in ether, leaving disk DEAD and set to
      XenbusStateClosing. When the guest wants to disconnect the disk, umount will
      hang on blkif_release()->xlvbd_release_gendisk() as it is unable to send any IO
      to the disk, which prevents clean system shutdown.
      
      Solution:
      Don't disconnect backend until frontend state switched to XenbusStateClosed.
      Signed-off-by: default avatarJoe Jin <joe.jin@oracle.com>
      Cc: Daniel Stodden <daniel.stodden@citrix.com>
      Cc: Jens Axboe <jaxboe@fusionio.com>
      Cc: Annie Li <annie.li@oracle.com>
      Cc: Ian Campbell <Ian.Campbell@eu.citrix.com>
      [v1: Modified description a bit]
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      6f5986bc
  2. 09 Aug, 2011 1 commit
  3. 14 Jul, 2011 2 commits
  4. 30 Jun, 2011 2 commits
  5. 20 Jun, 2011 3 commits
  6. 13 Jun, 2011 10 commits
  7. 12 Jun, 2011 8 commits
  8. 11 Jun, 2011 13 commits