2
0
mirror of https://github.com/xcat2/xNBA.git synced 2025-03-27 02:26:14 +00:00

[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>
This commit is contained in:
Michael Brown 2010-09-22 00:20:31 +01:00
parent d052efb254
commit adbe63860a

View File

@ -647,8 +647,16 @@ static struct aoe_command * aoecmd_create ( struct aoe_device *aoedev,
static int aoedev_ata_command ( struct aoe_device *aoedev,
struct interface *parent,
struct ata_cmd *command ) {
struct net_device *netdev = aoedev->netdev;
struct aoe_command *aoecmd;
/* Fail immediately if net device is closed */
if ( ! netdev_is_open ( netdev ) ) {
DBGC ( aoedev, "AoE %s cannot issue command while net device "
"is closed\n", aoedev_name ( aoedev ) );
return -EWOULDBLOCK;
}
/* Create command */
aoecmd = aoecmd_create ( aoedev, &aoecmd_ata );
if ( ! aoecmd )