Przeglądaj źródła

[aoe] Fail immediately when network device is closed

Avoid a tedious timeout delay when attempting to issue a command over
a network device that has been closed.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 14 lat temu
rodzic
commit
adbe63860a
1 zmienionych plików z 8 dodań i 0 usunięć
  1. 8
    0
      src/net/aoe.c

+ 8
- 0
src/net/aoe.c Wyświetl plik

@@ -647,8 +647,16 @@ static struct aoe_command * aoecmd_create ( struct aoe_device *aoedev,
647 647
 static int aoedev_ata_command ( struct aoe_device *aoedev,
648 648
 				struct interface *parent,
649 649
 				struct ata_cmd *command ) {
650
+	struct net_device *netdev = aoedev->netdev;
650 651
 	struct aoe_command *aoecmd;
651 652
 
653
+	/* Fail immediately if net device is closed */
654
+	if ( ! netdev_is_open ( netdev ) ) {
655
+		DBGC ( aoedev, "AoE %s cannot issue command while net device "
656
+		       "is closed\n", aoedev_name ( aoedev ) );
657
+		return -EWOULDBLOCK;
658
+	}
659
+
652 660
 	/* Create command */
653 661
 	aoecmd = aoecmd_create ( aoedev, &aoecmd_ata );
654 662
 	if ( ! aoecmd )

Ładowanie…
Anuluj
Zapisz