s390/qeth: improve error reporting on IP add/removal
When adding & removing IP entries for rxip/vipa/ipato/hsuid, forward any resulting errors back to the sysfs-level caller. Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
e0b10844d9
commit
b9ea525012
@@ -588,10 +588,12 @@ int qeth_l3_add_ipato_entry(struct qeth_card *card,
|
||||
return rc;
|
||||
}
|
||||
|
||||
void qeth_l3_del_ipato_entry(struct qeth_card *card,
|
||||
enum qeth_prot_versions proto, u8 *addr, int mask_bits)
|
||||
int qeth_l3_del_ipato_entry(struct qeth_card *card,
|
||||
enum qeth_prot_versions proto, u8 *addr,
|
||||
int mask_bits)
|
||||
{
|
||||
struct qeth_ipato_entry *ipatoe, *tmp;
|
||||
int rc = -ENOENT;
|
||||
|
||||
QETH_CARD_TEXT(card, 2, "delipato");
|
||||
|
||||
@@ -606,10 +608,12 @@ void qeth_l3_del_ipato_entry(struct qeth_card *card,
|
||||
list_del(&ipatoe->entry);
|
||||
qeth_l3_update_ipato(card);
|
||||
kfree(ipatoe);
|
||||
rc = 0;
|
||||
}
|
||||
}
|
||||
|
||||
spin_unlock_bh(&card->ip_lock);
|
||||
return rc;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -619,7 +623,7 @@ int qeth_l3_add_vipa(struct qeth_card *card, enum qeth_prot_versions proto,
|
||||
const u8 *addr)
|
||||
{
|
||||
struct qeth_ipaddr *ipaddr;
|
||||
int rc = 0;
|
||||
int rc;
|
||||
|
||||
ipaddr = qeth_l3_get_addr_buffer(proto);
|
||||
if (ipaddr) {
|
||||
@@ -643,7 +647,7 @@ int qeth_l3_add_vipa(struct qeth_card *card, enum qeth_prot_versions proto,
|
||||
if (qeth_l3_ip_from_hash(card, ipaddr))
|
||||
rc = -EEXIST;
|
||||
else
|
||||
qeth_l3_add_ip(card, ipaddr);
|
||||
rc = qeth_l3_add_ip(card, ipaddr);
|
||||
|
||||
spin_unlock_bh(&card->ip_lock);
|
||||
|
||||
@@ -652,10 +656,11 @@ int qeth_l3_add_vipa(struct qeth_card *card, enum qeth_prot_versions proto,
|
||||
return rc;
|
||||
}
|
||||
|
||||
void qeth_l3_del_vipa(struct qeth_card *card, enum qeth_prot_versions proto,
|
||||
const u8 *addr)
|
||||
int qeth_l3_del_vipa(struct qeth_card *card, enum qeth_prot_versions proto,
|
||||
const u8 *addr)
|
||||
{
|
||||
struct qeth_ipaddr *ipaddr;
|
||||
int rc;
|
||||
|
||||
ipaddr = qeth_l3_get_addr_buffer(proto);
|
||||
if (ipaddr) {
|
||||
@@ -670,13 +675,14 @@ void qeth_l3_del_vipa(struct qeth_card *card, enum qeth_prot_versions proto,
|
||||
}
|
||||
ipaddr->type = QETH_IP_TYPE_VIPA;
|
||||
} else
|
||||
return;
|
||||
return -ENOMEM;
|
||||
|
||||
spin_lock_bh(&card->ip_lock);
|
||||
qeth_l3_delete_ip(card, ipaddr);
|
||||
rc = qeth_l3_delete_ip(card, ipaddr);
|
||||
spin_unlock_bh(&card->ip_lock);
|
||||
|
||||
kfree(ipaddr);
|
||||
return rc;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -686,7 +692,7 @@ int qeth_l3_add_rxip(struct qeth_card *card, enum qeth_prot_versions proto,
|
||||
const u8 *addr)
|
||||
{
|
||||
struct qeth_ipaddr *ipaddr;
|
||||
int rc = 0;
|
||||
int rc;
|
||||
|
||||
ipaddr = qeth_l3_get_addr_buffer(proto);
|
||||
if (ipaddr) {
|
||||
@@ -711,7 +717,7 @@ int qeth_l3_add_rxip(struct qeth_card *card, enum qeth_prot_versions proto,
|
||||
if (qeth_l3_ip_from_hash(card, ipaddr))
|
||||
rc = -EEXIST;
|
||||
else
|
||||
qeth_l3_add_ip(card, ipaddr);
|
||||
rc = qeth_l3_add_ip(card, ipaddr);
|
||||
|
||||
spin_unlock_bh(&card->ip_lock);
|
||||
|
||||
@@ -720,10 +726,11 @@ int qeth_l3_add_rxip(struct qeth_card *card, enum qeth_prot_versions proto,
|
||||
return rc;
|
||||
}
|
||||
|
||||
void qeth_l3_del_rxip(struct qeth_card *card, enum qeth_prot_versions proto,
|
||||
const u8 *addr)
|
||||
int qeth_l3_del_rxip(struct qeth_card *card, enum qeth_prot_versions proto,
|
||||
const u8 *addr)
|
||||
{
|
||||
struct qeth_ipaddr *ipaddr;
|
||||
int rc;
|
||||
|
||||
ipaddr = qeth_l3_get_addr_buffer(proto);
|
||||
if (ipaddr) {
|
||||
@@ -738,13 +745,14 @@ void qeth_l3_del_rxip(struct qeth_card *card, enum qeth_prot_versions proto,
|
||||
}
|
||||
ipaddr->type = QETH_IP_TYPE_RXIP;
|
||||
} else
|
||||
return;
|
||||
return -ENOMEM;
|
||||
|
||||
spin_lock_bh(&card->ip_lock);
|
||||
qeth_l3_delete_ip(card, ipaddr);
|
||||
rc = qeth_l3_delete_ip(card, ipaddr);
|
||||
spin_unlock_bh(&card->ip_lock);
|
||||
|
||||
kfree(ipaddr);
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int qeth_l3_register_addr_entry(struct qeth_card *card,
|
||||
|
Reference in New Issue
Block a user