s390: networking patches for linux-next
Subsystems (5)
cover s390: networking patches for linux-next
Dave,
here are small improvements for net/iucv/ and drivers/s390/net/ . They apply to linux-next.
Summary:
Hendrik Brueckner (1)af_iucv: use sk functions to modify sk->sk_ack_backlog
Ursula Braun (1)af_iucv: remove duplicate sock_set_flag
Klaus-Dieter Wacker (2)
lcs: ODEBUG: object is on stack, but not annotated.
lcs: Recognize return codes of ccw_device_set_online().
Einar Lueck (1)
ctcm: rollback in case of errors
Thanks,
Ursula
PATCH 1/5 af_iucv: use sk functions to modify sk->sk_ack_backlog
From: Hendrik Brueckner <[email protected]>
Instead of modifying sk->sk_ack_backlog directly, use respective socket functions.
---
net/iucv/af_iucv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/iucv/af_iucv.c +2 -2
@@ -536,7 +536,7 @@ void iucv_accept_enqueue(struct sock *palist_add_tail (&iucv_sk (sk)->accept_q, &par->accept_q);spin_unlock_irqrestore (&par->accept_q_lock, flags);iucv_sk (sk)->parent = parent; - parent->sk_ack_backlog++; +sk_acceptq_added (parent); }void iucv_accept_unlink (struct sock *sk)
@@ -547,7 +547,7 @@ void iucv_accept_unlink(struct sock *sk)spin_lock_irqsave (&par->accept_q_lock, flags);list_del_init (&iucv_sk (sk)->accept_q);spin_unlock_irqrestore (&par->accept_q_lock, flags); -iucv_sk (sk)->parent->sk_ack_backlog--; +sk_acceptq_removed (iucv_sk (sk)->parent);iucv_sk (sk)->parent =NULL ;sock_put (sk); }
PATCH 2/5 af_iucv: remove duplicate sock_set_flag
In reply to Ursula BraunFrom: Ursula Braun <[email protected]>
Remove duplicate sock_set_flag(sk, SOCK_ZAPPED) in iucv_sock_close, which has been overlooked in September-commit 7514bab04e567c9408fe0facbde4277f09d5eb74.
---
net/iucv/af_iucv.c | 1 - 1 file changed, 1 deletion(-)
net/iucv/af_iucv.c +0 -1
@@ -428,7 +428,6 @@ static void iucv_sock_close(struct sockbreak ;default : -sock_set_flag (sk,SOCK_ZAPPED );/* nothing to do here */ break ; }
PATCH 3/5 lcs: ODEBUG: object is on stack, but not annotated.
In reply to Ursula BraunFrom: Klaus-Dieter Wacker <[email protected]>
Timer_list structure in lcs_send_lancmd() is allocated on stack. Initialization with init_timer() leads to above ODEBUG message. Instead use init_timer_on_stack() which prevents above msg.
---
drivers/s390/net/lcs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/s390/net/lcs.c +1 -1
@@ -889,7 +889,7 @@ lcs_send_lancmd(struct lcs_card *card, s rc =lcs_ready_buffer (&card->write, buffer);if (rc)return rc; -init_timer (&timer); +init_timer_on_stack (&timer); timer.function = lcs_lancmd_timeout; timer.data = (unsigned long ) reply; timer.expires = jiffies +HZ *card->lancmd_timeout;
PATCH 4/5 lcs: Recognize return codes of ccw_device_set_online().
In reply to Ursula BraunFrom: Klaus-Dieter Wacker <[email protected]>
The creation of a new lcs device requires a call to the function ccw_device_set_online() for the read and the write channel. Failure of either call should terminate the lcs device creation immediately with return code -ENODEV.
---
drivers/s390/net/lcs.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/s390/net/lcs.c +9 -3
@@ -2130,8 +2130,12 @@ lcs_new_device(struct ccwgroup_device *c card->write.ccwdev = ccwgdev->cdev[1 ]; recover_state = card->state; -ccw_device_set_online (card->read.ccwdev); -ccw_device_set_online (card->write.ccwdev); + rc =ccw_device_set_online (card->read.ccwdev); +if (rc) + goto out_err; + rc =ccw_device_set_online (card->write.ccwdev); +if (rc) + goto out_werr;LCS_DBF_TEXT (3 , setup,"lcsnewdv" );
@@ -2210,8 +2214,10 @@ netdev_out:return 0 ; out: -ccw_device_set_offline (card->read.ccwdev);ccw_device_set_offline (card->write.ccwdev); +out_werr: +ccw_device_set_offline (card->read.ccwdev); +out_err:return -ENODEV ; }
PATCH 5/5 ctcm rollback in case of errors
In reply to Ursula BraunFrom: Einar Lueck <[email protected]>
Group device now cleanly reacts to failures during channel start and implements a clean rollback.
---
drivers/s390/net/ctcm_main.c | 59 ++++++++++++++++++++++++++++++------------- 1 file changed, 42 insertions(+), 17 deletions(-)
drivers/s390/net/ctcm_main.c +42 -17
@@ -1530,11 +1530,16 @@ static int ctcm_new_device(struct ccwgrostruct net_device *dev;struct ccw_device *cdev0;struct ccw_device *cdev1; +struct channel *readc; +struct channel *writec;int ret; +int result; priv =dev_get_drvdata (&cgdev->dev); -if (!priv) -return -ENODEV ; +if (!priv) { + result = -ENODEV ; + goto out_err_result; + } cdev0 = cgdev->cdev[0 ]; cdev1 = cgdev->cdev[1 ];
@@ -1545,31 +1550,40 @@ static int ctcm_new_device(struct ccwgrosnprintf (write_id,CTCM_ID_SIZE ,"ch-%s" ,dev_name (&cdev1->dev)); ret =add_channel (cdev0, type, priv); -if (ret) -return ret; +if (ret) { + result = ret; + goto out_err_result; + } ret =add_channel (cdev1, type, priv); -if (ret) -return ret; +if (ret) { + result = ret; + goto out_remove_channel1; + } ret =ccw_device_set_online (cdev0);if (ret !=0 ) { -/* may be ok to fail now - can be done later */ CTCM_DBF_TEXT_ (TRACE ,CTC_DBF_NOTICE ,"%s(%s) set_online rc=%d" ,CTCM_FUNTAIL , read_id, ret); + result = -EIO ; + goto out_remove_channel2; } ret =ccw_device_set_online (cdev1);if (ret !=0 ) { -/* may be ok to fail now - can be done later */ CTCM_DBF_TEXT_ (TRACE ,CTC_DBF_NOTICE ,"%s(%s) set_online rc=%d" ,CTCM_FUNTAIL , write_id, ret); + + result = -EIO ; + goto out_ccw1; } dev =ctcm_init_netdevice (priv); -if (dev ==NULL ) - goto out; +if (dev ==NULL ) { + result = -ENODEV ; + goto out_ccw2; + }for (direction =READ ; direction <=WRITE ; direction++) { priv->channel[direction] =
@@ -1587,12 +1601,14 @@ static int ctcm_new_device(struct ccwgro/* sysfs magic */ SET_NETDEV_DEV (dev, &cgdev->dev); -if (register_netdev (dev)) - goto out_dev; +if (register_netdev (dev)) { + result = -ENODEV ; + goto out_dev; + }if (ctcm_add_attributes (&cgdev->dev)) { -unregister_netdev (dev); - goto out_dev; + result = -ENODEV ; + goto out_unregister; }strlcpy (priv->fsm->name, dev->name,sizeof (priv->fsm->name));
@@ -1608,13 +1624,22 @@ static int ctcm_new_device(struct ccwgro priv->channel[WRITE]->id, priv->protocol);return 0 ; +out_unregister: +unregister_netdev (dev); out_dev:ctcm_free_netdevice (dev); -out: +out_ccw2:ccw_device_set_offline (cgdev->cdev[1 ]); +out_ccw1:ccw_device_set_offline (cgdev->cdev[0 ]); - -return -ENODEV ; +out_remove_channel2: + readc =channel_get (type, read_id,READ ); +channel_remove (readc); +out_remove_channel1: + writec =channel_get (type, write_id,WRITE ); +channel_remove (writec); +out_err_result: +return result; }/**
David Miller
maintainerFrom: Ursula Braun <[email protected]>
Date: Thu, 15 Oct 2009 10:54:54 +0200
Quoted 2 lines
here are small improvements for
net/iucv/anddrivers/s390/net/. They apply to linux-next.
All applied, thanks.