From patchwork Tue Dec 19 21:51:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 10124601 X-Patchwork-Delegate: leon@leon.nu 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 837816019C for ; Tue, 19 Dec 2017 21:51:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 732D02962E for ; Tue, 19 Dec 2017 21:51:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 66D6D29628; Tue, 19 Dec 2017 21:51:13 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 D7AA828A3B for ; Tue, 19 Dec 2017 21:51:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752298AbdLSVvL (ORCPT ); Tue, 19 Dec 2017 16:51:11 -0500 Received: from mail-he1eur01on0081.outbound.protection.outlook.com ([104.47.0.81]:16928 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752103AbdLSVvK (ORCPT ); Tue, 19 Dec 2017 16:51:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=/ZHrbnDj4TegrRR1iXQgqyF8dnF+LBN+twaLKHLATUE=; b=WCVS3ufyu9P54Bl2BcyLJMxMuGn0pv/gRHmacG6eQH0wpnYMxKwfNRT6Jj+QQqpsioZKgcTCiXkaWuxr5x7045YoCfWelBZ7sQtSrOj3g7IG97C5Jdwp2D2ToW46nO2UNPrTKSi10M9vF1PAzJr5a9XAGDjmdpAGvW99D1hVduw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=jgg@mellanox.com; Received: from mlx.ziepe.ca (70.74.179.152) by HE1PR0501MB2860.eurprd05.prod.outlook.com (2603:10a6:3:c2::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.345.14; Tue, 19 Dec 2017 21:51:08 +0000 Received: from jgg by mlx.ziepe.ca with local (Exim 4.86_2) (envelope-from ) id 1eRPmw-0007WD-1s for linux-rdma@vger.kernel.org; Tue, 19 Dec 2017 14:51:02 -0700 Date: Tue, 19 Dec 2017 14:51:02 -0700 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org Subject: [PATCH v3 rdma-core] srp_daemon: Remove duplicate sync_res shutdown Message-ID: <20171219215102.GA28841@ziepe.ca> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-Originating-IP: [70.74.179.152] X-ClientProxiedBy: VI1PR0501CA0021.eurprd05.prod.outlook.com (2603:10a6:800:92::31) To HE1PR0501MB2860.eurprd05.prod.outlook.com (2603:10a6:3:c2::8) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 95536b7a-bf10-4ded-67b2-08d5472a9c9e X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(48565401081)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060); SRVR:HE1PR0501MB2860; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0501MB2860; 3:lIuq8m/onAR/ep9dRcoVpEUopB0QKWChg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GIP0Kydxs8dBQ+N3/NAeWDSNXz/4D0VHpQ5eQHY4urfSwRw9krmcL6ecn/THyk8dJGDYZ3KJCnknDBHpUxA1YFmTAg11LEXmjEhK3/hpGcBuB8C3eL1fZCvJRQ5sXu6HMAsfc9zBcUnhmhm/eSTUjiOIuQ68BvPxQwqAgg7P6MisqeA0v0ra5vB7r8AuZOBjV4XFmtT0ZwG5Cb3mfQWwBa7nYme7DTlk1ilJk/PiJCB8Po32DAlh82wa7PKYP3w8F3t716orh0WykEnIXJbDZh8jELPowTdoT65AU5JEyIXp07TyDJhYZdBF; 4:sQnC79YknVSGXb3KQNM7qh73EQNZhNgWOUUHbUL2vnOnpngwESHWj6TOMFaGirp2DQYJY5FfjbqMENA9bZyYkA2FuvscFvg6lbkksLcY8MaV9jnxtucyPUo7LYifiRPobyzoFxkuiWmnIUjVHbrc0HISShv5epmLq+EMF00fbXS68d7ze+pcfz01hDcxRA2U1g9U4Z3Qa3wsdbk/yEWcYwlP7zCE0jdfc8ytBxyv1HSEF8U3VWYaqQx1oYMTL5bwBxo2GgWFVNHPEXasQgHShw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3002001)(3231023)(6055026)(6041248)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123564025)(20161123562025)(20161123560025)(6072148)(201708071742011); SRVR:HE1PR0501MB2860; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:HE1PR0501MB2860; X-Forefront-PRVS: 052670E5A4 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(346002)(366004)(376002)(39860400002)(189003)(199004)(66066001)(9746002)(46656002)(47776003)(9786002)(8676002)(81166006)(8936002)(6916009)(81156014)(478600001)(122856001)(5660300001)(33656002)(9686003)(68736007)(105586002)(6116002)(3846002)(2361001)(2351001)(53936002)(36756003)(83506002)(69596002)(52116002)(33896004)(106356001)(1076002)(57986006)(83796002)(23726003)(386003)(59450400001)(16586007)(7736002)(575784001)(50466002)(58126008)(97736004)(2906002)(316002)(305945005)(86362001)(18370500001)(24400500001)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0501MB2860; H:mlx.ziepe.ca; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0501MB2860; 23:4VqvnRukkHe/ObdW6IMPXkje5xw4Pz9cLdfRB7P?= =?us-ascii?Q?7KDHLIbSPu7hXGuu8UMsDfkt1bFPy0AbjEgByxSLKNLaeKUyVwrap5moNijA?= =?us-ascii?Q?c+OzZ41BbUyMGbd105dq8jZoCYBq+AbiUCjzAXy8JUeDTYc8ty8v2DOwyc+l?= =?us-ascii?Q?F2sW+N1PQCZY+B5itvZ+CVkcHPHL5bLI7T4kuo8rEKQdxsT6GvSIIrA5NZmf?= =?us-ascii?Q?Z/Kn+gHnfNDiOoKjurZq1A7bBQm+isJQ+Mc1FB3Q2/CWlhp1ruXCc4qhnuAb?= =?us-ascii?Q?MWLAdegxwgJQ20t56VKnvIutwgdAbsgs6MBKeGVbQOYFs35rib1kywZ6/rtW?= =?us-ascii?Q?2Bes02W73anh7yOynXiFOpwtrEBz6QxjMh5UvNqR62F6wQ2pF2d5IVcSGVCa?= =?us-ascii?Q?ROYnvL1Yl/f8NETAVmjRIjXT3QwYXlVzr0zFAFEjyOveKeHTWwuxh4g6hJb0?= =?us-ascii?Q?wHxcn/txhl6itGOE7ZHYiSI46s0d4Amre5vUuOX6asHWIIA7pjX7P/x6Xo7q?= =?us-ascii?Q?eXBXwx9EA+tAhhyLVGFz5EiY4zoUsj5kY+UQ524X1bZ80NQ3Sw5sH7RN3n1Q?= =?us-ascii?Q?YbbN5+tVj8pG4VsL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xShkGK0NOrWi9hn0ur5KLJmXd6k0Bc/HbktRqtR2ugBP6bdJs4Bi/lobhln7Ep3uLlJqCUBl/y9JTzrleWW/9i32a63Wez4PVe1eu34cfmspxhdrDTV9HuelimK/5Lsbn7/uOru5jDrQ=; 5:JPpgWHTwrFfm099QaOwt1p4YvWYth2Du3bpBFM3pGHTK0+6lSKVm07/gORN983D/EnPOKjSYKEHqENjL2d4hXhiA/WUBbsETvJuythj6sfLqJwBLT6CWmrPhvUIl5IwtkCEkuhu22ZSRPKRppWniHAQYjmfysvflhCBSvA2IRsI=; 24:Sqz1xPD+N9+sG6WZRHm3urEu8NU0ikf7w1limn+lj4fOqBwANC8NsRv7I9l+VQOKPlyKl0SVyu2CaOSqpbDSACz0MCzRSc1GnNPrk8MNEEI=; 7:mFLQtBKczaUbR+KxHpIQikUqXyU42WawGS67TIBe5/epMtpX6zBMnA+hkVYf5TeB2OOmsnuW1uq8XCKH4dr8Q3J5q+BQHQXjJvT+PcK3WRksK5f2aFxOJskyEr1QGVOVQ3nqzQPM/D4B38khH6baVqwn1rw/VE0vK18EL6vgaFu5OaNgtvlZCnyTIRT5ltLVVRvOToJy1k1Hs+xBxdDzI2gO+KGCstvWh1ogFcWJabqt6E10KHEpjVwKXcqyjfXu SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2017 21:51:08.2587 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 95536b7a-bf10-4ded-67b2-08d5472a9c9e X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0501MB2860 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The very first thing free_res does is the same lock/signal/unlock sequence, so there is no reason to open code it before calling free_res. res->sync_res always exists at this point so remove the assert too. Signed-off-by: Jason Gunthorpe Reviewed-by: Bart Van Assche Reviewed-by: Honggang Li --- srp_daemon/srp_daemon.c | 6 ------ 1 file changed, 6 deletions(-) v3: - Delete stray edit Bart, Yes, must have been a stray editor edit, I did not even look at v2 in the mailer before sending it, since the one line change was so simple :( This one compiles. diff --git a/srp_daemon/srp_daemon.c b/srp_daemon/srp_daemon.c index cec36db2e0f12e..5995e6a6173046 100644 --- a/srp_daemon/srp_daemon.c +++ b/srp_daemon/srp_daemon.c @@ -2073,12 +2073,6 @@ static int ibsrpdm(int argc, char *argv[]) if (ret) pr_err("Querying SRP targets failed\n"); - assert(res->sync_res); - pthread_mutex_lock(&res->sync_res->retry_mutex); - res->sync_res->stop_threads = 1; - pthread_cond_signal(&res->sync_res->retry_cond); - pthread_mutex_unlock(&res->sync_res->retry_mutex); - free_res(res); umad_done: umad_done();