From patchwork Thu Aug 31 09:19:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Reinecke X-Patchwork-Id: 9931627 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 25D5D602F0 for ; Thu, 31 Aug 2017 09:20:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 250D8288BD for ; Thu, 31 Aug 2017 09:20:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 183E2288BF; Thu, 31 Aug 2017 09:20:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B8694288BD for ; Thu, 31 Aug 2017 09:20:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750930AbdHaJUA (ORCPT ); Thu, 31 Aug 2017 05:20:00 -0400 Received: from mx2.suse.de ([195.135.220.15]:59686 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750918AbdHaJT6 (ORCPT ); Thu, 31 Aug 2017 05:19:58 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 3D1BAAF06; Thu, 31 Aug 2017 09:19:36 +0000 (UTC) From: Hannes Reinecke To: "Martin K. Petersen" Cc: Christoph Hellwig , James Bottomley , linux-scsi@vger.kernel.org, Johannes Thumshirn , Hannes Reinecke , Hannes Reinecke Subject: [PATCH 1/3] fcoe: move fcoe_interface_remove() out of fcoe_interface_cleanup() Date: Thu, 31 Aug 2017 11:19:32 +0200 Message-Id: <1504171174-37989-2-git-send-email-hare@suse.de> X-Mailer: git-send-email 1.8.5.6 In-Reply-To: <1504171174-37989-1-git-send-email-hare@suse.de> References: <1504171174-37989-1-git-send-email-hare@suse.de> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP No functional change. Signed-off-by: Hannes Reinecke Reviewed-by: Lee Duncan Acked-by: Johannes Thumshirn --- drivers/scsi/fcoe/fcoe.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c index 85f9a3e..135bdcf 100644 --- a/drivers/scsi/fcoe/fcoe.c +++ b/drivers/scsi/fcoe/fcoe.c @@ -501,11 +501,6 @@ static void fcoe_interface_cleanup(struct fcoe_interface *fcoe) struct net_device *netdev = fcoe->netdev; struct fcoe_ctlr *fip = fcoe_to_ctlr(fcoe); - rtnl_lock(); - if (!fcoe->removed) - fcoe_interface_remove(fcoe); - rtnl_unlock(); - /* Release the self-reference taken during fcoe_interface_create() */ /* tear-down the FCoE controller */ fcoe_ctlr_destroy(fip); @@ -2140,6 +2135,11 @@ static void fcoe_destroy_work(struct work_struct *work) cdev = fcoe_ctlr_to_ctlr_dev(ctlr); fcoe_if_destroy(port->lport); + + rtnl_lock(); + if (!fcoe->removed) + fcoe_interface_remove(fcoe); + rtnl_unlock(); fcoe_interface_cleanup(fcoe); mutex_unlock(&fcoe_config_mutex); @@ -2254,6 +2254,8 @@ static int _fcoe_create(struct net_device *netdev, enum fip_mode fip_mode, printk(KERN_ERR "fcoe: Failed to create interface (%s)\n", netdev->name); rc = -EIO; + if (!fcoe->removed) + fcoe_interface_remove(fcoe); rtnl_unlock(); fcoe_interface_cleanup(fcoe); mutex_unlock(&fcoe_config_mutex);