|
@@ -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 )
|