From patchwork Thu Dec 8 14:52:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 9466495 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 973B960231 for ; Thu, 8 Dec 2016 14:52:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8A99928476 for ; Thu, 8 Dec 2016 14:52:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7F26628589; Thu, 8 Dec 2016 14:52:57 +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 C60D928476 for ; Thu, 8 Dec 2016 14:52:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752016AbcLHOw4 (ORCPT ); Thu, 8 Dec 2016 09:52:56 -0500 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:44845 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753428AbcLHOwx (ORCPT ); Thu, 8 Dec 2016 09:52:53 -0500 Received: from pps.filterd (m0044012.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id uB8EntGY024717; Thu, 8 Dec 2016 06:52:44 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fb.com; h=from : to : subject : date : message-id : mime-version : content-type; s=facebook; bh=8u9agf/ROMc5FFlaeCzfgUnoQV3bRHWjdhZIViq9qlg=; b=T9xxSz2zGayfO+txxebtiL7H4BDFo3YT2w2wcmim1OSCUnlrEqxqdElMLzrskn9yIJEm HculzILJe27VwxJYndMJp9xq7G0+1Ki5Mr8C7GyN6HVfPR2+zgyuAtY3AYYcJASNHk5q 1S+MzNyuzi4QRD/QRjM2MEmrxJTkEjYhHCg= Received: from maileast.thefacebook.com ([199.201.65.23]) by mx0a-00082601.pphosted.com with ESMTP id 27799208un-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 08 Dec 2016 06:52:44 -0800 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (192.168.183.28) by o365-in.thefacebook.com (192.168.177.27) with Microsoft SMTP Server (TLS) id 14.3.294.0; Thu, 8 Dec 2016 09:52:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.onmicrosoft.com; s=selector1-fb-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=baoMLwSryd9Tf1TnO9mfw0S3hW5lRtObSnCIPOf4Hf0=; b=XpPZgfl2pg4nxf4tfzAWlyefZ3XGD97rqctvqjP/XPMNCoa0/Xc9or1ch7a0w5hnfzTn+A02mmdjG3MZaTBh8oLK4Flg+OkaDmsAFRDNHdac2kNbeJDUPnsDJe+j9r0ec8o5+ONnkbkerjNvvjEzTk29zMaTYJJalUP3q/TavXc= Received: from localhost (2620:10d:c091:180::945a) by BN6PR15MB1315.namprd15.prod.outlook.com (10.172.206.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.761.9; Thu, 8 Dec 2016 14:52:39 +0000 From: Josef Bacik To: , , , Subject: [PATCH] nbd: reset the setup task for NBD_CLEAR_SOCK Date: Thu, 8 Dec 2016 09:52:35 -0500 Message-ID: <1481208755-24700-1-git-send-email-jbacik@fb.com> X-Mailer: git-send-email 2.5.5 MIME-Version: 1.0 X-Originating-IP: [2620:10d:c091:180::945a] X-ClientProxiedBy: BN6PR10CA0016.namprd10.prod.outlook.com (10.172.16.154) To BN6PR15MB1315.namprd15.prod.outlook.com (10.172.206.141) X-MS-Office365-Filtering-Correlation-Id: cc170284-d497-45f2-fb95-08d41f79db97 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BN6PR15MB1315; X-Microsoft-Exchange-Diagnostics: 1; BN6PR15MB1315; 3:jaovcwt/niZm+Io+GbtoYyV3PZJMonr11hCt0A8ItRImciXCYrey17bJtm0AihRpuKhxkbeFtx251ANybZKt1E3gk5yTiAp0joJnwVavfUvWqBFwh8iNRcF+C6kDRivMrCqypvlOoIo9nfEHb/0r1+AOoC+QxisInrQcIMd+FIl8RZgt3nsVYBJHfv4PSGkJ3eXv9dbXPprijZVE+jGx42idcIc0wd1XdYw2zY2O92GZ4nJ3koxnvzydj/dGe82DhgsEVMFyusasp/ITPsGhUw== X-Microsoft-Exchange-Diagnostics: 1; BN6PR15MB1315; 25:6OgkL4qse0T86G2Ql73bzgSCLHnZt4MTptu55LXDOjGEMDhJUrhuPt0KoU/OSdUEZyTa7aZjBf/c7WZLd4LPyiD9olJ7xGcs5WSJtQX/KVFsLJ8MOcNqHGtyd+JdieGxSp/e8WQD6KNGdWKmGZsaayoIqaGLa6kJ1YO8QWafDrH+/B35myf4/y+HVeAi6BnpeQ41papDXHZI5gk/qhbE0wl22tWl0LUkr+cPqHuf6h7eWnnDo8t213wvVDNiG6lBHmiHkPza1J1kYzz8L+9T2vh6akaEYQF8wfUGvML/FljXDu0Qtk3kYiYrfUUdytKQMyJ941WSTgsFEgYdQQoQxD4wxHhluE9FV1yYsSKO7Ke/yIo12qAFJkXHV3AzqrcGGHsSWpcAs92uUal5ExrjRH7fGq3QSfwq9SiPmaSa8ippZsQXnyO95MAzf/7pxmbrfRtDunLRlXLmutsxCauTAwryKUOwlqiPFS8EZj4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L15rLhYNz0l5GWMNdzUE6oEtvE/aBIHZzMTnQPFNx X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(67672495146484); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6041248)(20161123560025)(20161123562025)(20161123564025)(20161123555025)(6072148); SRVR:BN6PR15MB1315; BCL:0; PCL:0; RULEID:; SRVR:BN6PR15MB1315; X-Microsoft-Exchange-Diagnostics: 1; BN6PR15MB1315; 4:K7ZKp2uaOIbKzIerzcEumQc8hcpf8jXiz4Tns8idlJB0mCCSNGbVK7Ewitl1bvN76+7GYwuNuPlHoPD2OMxnJnW4uu1wu8tRwZA1hON3wxzO1gca49WQppcBK4pxqfHS37kW7pSQkphq73aUrlCSVFqli3nj9A/C9DKzYH/qomv6im5lEhd86wi/9jRWZPgPe8Fzo3PqAULA8qVGCFwNR8OtQC1lIerJiX1jjYQ66oB9k6pK07NP5IhJWIdRbSV3oTJXRiCwmZ1p99PyjkKCndJC/jJC+YwZO+IjlAKAgNUdfUgpTcGTHJXz52L1N+rGLAvPOlDeFwHyMjDupmFC5RqDvNrRNPGtYF4ZwRZhY8pEMIJwAFlAkB8WRBn6YBEggXh0zqnDvmCjjtDKuaJosCAhr1Y3P/I0QZ4VlisbeShzevUF9/VpHgiUrtXrT2h1pRVgF78NxFicIzerGOs0UDO8SiuvdO+HCpov8/wyXJXOrzYHiZffDuZE2gaKMP9IL8/2e8NTvic0gpdRdAXB4X3yjwWDbptswv+fvSipUHaFHNd5I/YsWitSRf859eQQCSvlGmT3lOAkSh5n+UCe1Cq0id4CT/Fa11fzhGwfxlu9sA8kHoSSftTO59F39jDO X-Forefront-PRVS: 0150F3F97D X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6069001)(6009001)(7916002)(39860400002)(39410400002)(39850400002)(39840400002)(39450400003)(199003)(189002)(5660300001)(6666003)(6636002)(2201001)(6496003)(733004)(6116002)(6486002)(7736002)(305945005)(5001770100001)(107886002)(5003940100001)(189998001)(86362001)(2906002)(97736004)(33646002)(92566002)(50226002)(81166006)(8676002)(36756003)(38730400001)(50986999)(101416001)(7846002)(50466002)(68736007)(48376002)(42186005)(76506005)(47776003)(81156014)(106356001)(105586002); DIR:OUT; SFP:1102; SCL:1; SRVR:BN6PR15MB1315; H:localhost; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: fb.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR15MB1315; 23:PN5swUv/6G+91tavWLsjecruEOujFPyohRSiFwz5g?= =?us-ascii?Q?pcxz0RKZEOnQsHvcNYbI04aAs4tq2pMm55J9Bj9E+qoI5oDwGkpkuC/Wr3hf?= =?us-ascii?Q?mCgazWqBoqt/2jL4kLN5gZ2OZm1o8ORrDQVHuG9zB82LAq0dxpCvbg4G+7+u?= =?us-ascii?Q?8o/W/Vj50ycm6RRr1PV2ubDJ8QouG2UX5xY3yUngivs7cPyTH+BMChRrYcIZ?= =?us-ascii?Q?xCCWeQC5cAUDophEtXVBhYukfG2oF4jdkgA9pEnI604CjApf7huTaqbGHUvv?= =?us-ascii?Q?LVqJn6TjojJjL59mTpQdsk5hwVzzPrYTx2mPAZCkiQ7fuAbygGQ7fwUA1O3L?= =?us-ascii?Q?/5eCPfsb3ckTF6I215R0AO5cIYCJJmgcJGuithPDELCA6i8AxVT+65LrBjJI?= =?us-ascii?Q?nJjynYRJCJ1/8L4DNbuzvZN3SRSGFRDDFH64SM1/XNeWV2/yNE9oO2AzdPLr?= =?us-ascii?Q?fvR0o2VgoQyaVO3O7ynaWDxWVGyyp1pxMV7Hz3d/kY71LAeqZUo8fCNhBY3c?= =?us-ascii?Q?R6KHsJh21yeLeKcdODRi6uhE/iIMvZi83mLLW4Ne2oaDve+pyVmoVMIC5CeE?= =?us-ascii?Q?dRBwq+S3nFla9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a48gZZU4kuqYZF57k4x8= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Dec 2016 14:52:39.9765 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR15MB1315 X-OriginatorOrg: fb.com X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-12-08_08:, , signatures=0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If an app exits before running NBD_DO_IT but after adding sockets we can end up not being allowed to do a new nbd device. Fix this by making NBD_CLEAR_SOCK reset the setup_task. Signed-off-by: Josef Bacik --- drivers/block/nbd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index 0e6e52df..99c8446 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -705,6 +705,7 @@ static int __nbd_ioctl(struct block_device *bdev, struct nbd_device *nbd, kfree(nbd->socks); nbd->socks = NULL; nbd->num_connections = 0; + nbd->task_setup = NULL; } return 0;