John Fastabend wrote:
> This patch adds a check to fail gracefully when the netdevice
> is bonded.  Previously, the error was detected but the stack
> would continue to load.  This resulted in a partially enabled
> fcoe intance and errors when the fcoe instance was destroy.
> 
> Signed-off-by: John Fastabend <[email protected]>
> ---
> 
>  drivers/scsi/fcoe/fcoe.c |   10 +++++++++-
>  1 files changed, 9 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c
> index e6f7bf2..3f054a7 100644
> --- a/drivers/scsi/fcoe/fcoe.c
> +++ b/drivers/scsi/fcoe/fcoe.c
> @@ -228,6 +228,7 @@ static void fcoe_interface_destroy_work(struct 
> work_struct *work);
>  static struct fcoe_interface *fcoe_interface_create(struct net_device 
> *netdev)
>  {
>       struct fcoe_interface *fcoe;
> +     int err;
>  
>       fcoe = kzalloc(sizeof(*fcoe), GFP_KERNEL);
>       if (!fcoe) {
> @@ -246,7 +247,14 @@ static struct fcoe_interface 
> *fcoe_interface_create(struct net_device *netdev)
>       fcoe->ctlr.send = fcoe_fip_send;
>       fcoe->ctlr.update_mac = fcoe_update_src_mac;
>  
> -     fcoe_interface_setup(fcoe, netdev);
> +     err = fcoe_interface_setup(fcoe, netdev);
> +     if (err) {
> +             FCOE_NETDEV_DBG(netdev, "Bonded interfaces not supported\n");

This requires the err to only be about bonding.  That's currently the only 
failure
case, but let's put the message in fcoe_interface_setup() itself so that
other error returns can be possible someday.

That's a nit. The patch looks OK otherwise.

BTW, I want to support working on an enslaved interface someday, but that's
another patch and a bunch of testing.  It was working at one point.


> +             fcoe_ctlr_destroy(&fcoe->ctlr);
> +             kfree(fcoe);
> +             dev_put(netdev);
> +             return NULL;
> +     }
>  
>       return fcoe;
>  }
> 
> _______________________________________________
> devel mailing list
> [email protected]
> http://www.open-fcoe.org/mailman/listinfo/devel

_______________________________________________
devel mailing list
[email protected]
http://www.open-fcoe.org/mailman/listinfo/devel

Reply via email to