Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2188872imm; Thu, 20 Sep 2018 09:04:49 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZxBIlkWVwz11A2mH9mjnLoBGxT/Pp60ijf0UwfXodg0Ii5ahXSd3NF4Cyxt69fZhNulqVa X-Received: by 2002:a62:a216:: with SMTP id m22-v6mr41568366pff.163.1537459489180; Thu, 20 Sep 2018 09:04:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537459489; cv=none; d=google.com; s=arc-20160816; b=B9VQqvYiH9n1Lu0U//icUnARg4CTHsKx9aTGX1qwbGbx0J+LH+9DEuBQMALGwT59M7 jqZhIMVHKw218EM5sOLUp6JV8kJoZmnL4OKltDDCascWSsPVculsmnJ/5Rh6LNwR5Ivj /M+HyM2DJ6XViDjhI2a/ALvJ94Myu3vzJLsygFnU7PZCH2d4YVWmI+FbmkFx/cdyqAF5 F4LUz9tzHyoKfTdRFba7GqlSL/ce1zxg500SYqaIxQGbq49TT8OS3cg5d0kxN7dzFRaP 9EDiNvuv3dGtnBmT/lnpUccNq2/yNpWjeebPWwRBpt2rcOcZd9O7kYCp8UdGfpH227g6 7GYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:content-transfer-encoding:content-language :mime-version:user-agent:date:message-id:to:cc:subject:from :dkim-signature; bh=rCB4AQskVeGAViMfNWfEflBnprYQRkLNUoIJu5ELrI0=; b=A2Jc+OxBkCqEFScdf8yrRsgy3lsOPpD/yzqY/K/zQ3Q9IRD9f7RJzrQNwssm7I9zfR cnx09R02D1m+P3577NNwm5/IBDaM0g4v6YGaydX8tHllbZ61/ithC4NSSswo0N1WAgH6 XV2NkcTDWmzyq+UhOCodM7PCWp+RWo1s2mARj2xKTDY5tgzVD7MNhf8GmFc2TzJilj0i L340u0sGyK5FK9xdfVFW57LYn0bH6+RMybHyXk1Pu+S7fkZw3zBUhwU4WxquIDQLLimp HFIg43myXODciLWB0bekPmCAoEC5+O3k3DbpRnFiIBQ8oARv/AefpqDeySd1Xdossvv1 XWqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=DReRU2gE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u26-v6si21803197pge.590.2018.09.20.09.04.26; Thu, 20 Sep 2018 09:04:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=DReRU2gE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728465AbeITVrs (ORCPT + 99 others); Thu, 20 Sep 2018 17:47:48 -0400 Received: from mail-eopbgr20132.outbound.protection.outlook.com ([40.107.2.132]:35865 "EHLO EUR02-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726163AbeITVrs (ORCPT ); Thu, 20 Sep 2018 17:47:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rCB4AQskVeGAViMfNWfEflBnprYQRkLNUoIJu5ELrI0=; b=DReRU2gEqANHTvAUC0yrDO/J96orxYbrfGUr8eOWBhqSTLSEMD+OFssHIgp3tbwwmAjhoaUviUS8yp7BgvyD8o7fqioounhyh33L+9N867rXzLQBT1pyxc6hx+CVMuC9ZIM5O3XGq5U9U9GqE3macpYQM3rFlj71RxH+D/yPUdk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=aryabinin@virtuozzo.com; Received: from [172.16.25.12] (185.231.240.5) by DB7PR08MB3258.eurprd08.prod.outlook.com (2603:10a6:5:1f::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.17; Thu, 20 Sep 2018 16:03:34 +0000 From: Andrey Ryabinin Subject: md: dead code in md_alloc() Cc: Kirill Tkhai , linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org To: NeilBrown , Shaohua Li Message-ID: <3003e71d-ede0-0d55-973d-47c1c06e05ba@virtuozzo.com> Date: Thu, 20 Sep 2018 19:03:57 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [185.231.240.5] X-ClientProxiedBy: AM0PR02CA0021.eurprd02.prod.outlook.com (2603:10a6:208:3e::34) To DB7PR08MB3258.eurprd08.prod.outlook.com (2603:10a6:5:1f::20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d357a21a-673e-42e2-1707-08d61f129ed5 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534165)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:DB7PR08MB3258; X-Microsoft-Exchange-Diagnostics: 1;DB7PR08MB3258;3:XjzktjwjX9f1mcWLEJsTmln3eIxy9NeBWjsTFEflY/9pyS0T75swttsRUrkqqcM/iW0klbCgtMdf4IwuOeOpKLZ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uME3+hVgOAf3Q2sJpeXkk5HYr/71J0jePlLx8+4eVKqNjC7chdNIfa8vChLHqDVz4FE842Q7ihACsDMzENqXGbcmI0qXEvRe0G60lOAhfsVu1Nx6col2Fzddpnm7WnFiZFZVDqPHek9arOBKHB3+DDzCsPVG30/2UdGGSv8g3uGfKrecTDamY38n4WbTtsvuRVzSGKUDskTGIzG/1YQXSJx5IMEbfBdudGIHoLIcHFPJ/P8XXlr0who;4:gf500ZhKAcOvOPVst5HPqJo8KXwxpZJodwHrincdZfA26BP57dGVh7J4ENXOoLGl67do/GVMJRns9V5o7VUVDQN//SIyGygbf3mN8c4eh77H3sCbNGILiRfVgqU5L4OWG9TuzmGRvFsG1dmNLj2bEnJgIV0dZoPoTC7UxlVNNBU9mGkdraUrxf2gisyDV/aJEjpIoeeEmWDDBOQe95/y/DPVo0MI/DvCcFzkCMR9J9+VtRa5JMfZxxsbTqDdOWJs+PwwJrMWF5xqHtvieUBzbg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(8121501046)(5005006)(3231355)(944501410)(52105095)(3002001)(10201501046)(93006095)(93001095)(149027)(150027)(6041310)(20161123560045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(201708071742011)(7699051);SRVR:DB7PR08MB3258;BCL:0;PCL:0;RULEID:;SRVR:DB7PR08MB3258; X-Forefront-PRVS: 0801F2E62B X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6049001)(376002)(346002)(366004)(39850400004)(396003)(136003)(199004)(189003)(65806001)(97736004)(486006)(16526019)(305945005)(478600001)(186003)(68736007)(4326008)(476003)(66066001)(5660300001)(64126003)(6666003)(36756003)(6116002)(3846002)(31696002)(65826007)(16576012)(58126008)(7736002)(2616005)(25786009)(77096007)(65956001)(956004)(53936002)(2906002)(230700001)(110136005)(86362001)(26005)(316002)(47776003)(8936002)(81166006)(6486002)(105586002)(81156014)(386003)(106356001)(50466002)(23676004)(2486003)(52146003)(52116002)(31686004)(8676002);DIR:OUT;SFP:1102;SCL:1;SRVR:DB7PR08MB3258;H:[172.16.25.12];FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtEQjdQUjA4TUIzMjU4OzIzOlhmTW4zMnAwYTJOQ1liMXYyQW9FRUxvMG1m?= =?utf-8?B?ZzBtMmJaUWNoTlQ4Z2tFV2MrVzc3U2pFcjhhT0FGQlpBRURvY2xUd3VINEd6?= =?utf-8?B?R05uS0N4bHZYQUY2K3NRWTUrekZZMUlhZlVaaDJXa2tRMVZobFkwdmhpcmFv?= =?utf-8?B?emdYbmdjN3lyTS8xN2NZK0wyVmlKdWNna2lkZklJNVY1Q1ltdGNxdks1Qzls?= =?utf-8?B?TUxOUFVkU0VzS1lOeU9PeThRc0pHT0hXMkhoVEM1Rit1OXJ0N3RUWk81NHF5?= =?utf-8?B?RXpSM1JXUTlVM3Rkc2dBWUV2ZGJudTU5NlZXZ0J0R1FhWkFocDZldkRtMGNo?= =?utf-8?B?VmRrWlJUQnk3U3hxMGVMZHJ5WUJDZzYzSnBPaWt0akdZY2ZKRjFybFJtN3pP?= =?utf-8?B?TVpuY2FrUGlBYXljWC9IeUtlbjhqTllrR2NXQm96SVJGNUZXZmtyYlR4cGhq?= =?utf-8?B?SnNENjljbEw3THdrcnRSNE1heW5MQkh5UjJxMmNDZU1oQTRXZzZiUDRLVkly?= =?utf-8?B?M0tKYlh1bTlXeno1SDN0VWhNTlh6bDdndUtBSFErRXdIZXRDNkE5TmtRN05Z?= =?utf-8?B?VENKcTRudXBaY2hJdk1VQkRFZ21HVUt4bXRIcUlZMUpZd2lvYnhuTjdOaXc3?= =?utf-8?B?a0FUTGVkTF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RfZ4ra4/PJpwKxs79PJ7Sg9nBxlJLLUU7wvgFFf7Oj5pnZRfIDEWUmm/8fHiSBhSs1Cbq2CNbmR111mQbQAg==;5:qAW9rGYMh2PoJDMrZE8KJaaazNg55REJH+DHPupqSMVuDKIYVjiBKjHe3UWwwPWBd0kYwm9F4gOKkQyRqZgzD6Bx3aIb/Jm+JpR/CMHZdrsdvClkpeFpl3KjmNkD/iNhHJTIsR/rzu2s0UvjBTjp7GjBNapU0Ti9/Npj2B96qLA=;7:R5r3wT5UORi0blWUeku8RTNXQYmsiO65ITP5C2UDP+U2YSHlQjcVz9FmVLSlgZ9A/UY1WNkSi0MB7LMHYlkjUjIj5xY3X3LqnmIl+6X3DAxdBC1zXamafBkS8kNPaMxAsIcQsoLl6o7qCrp/m8zn0jHe+AEG1Imv2ZiiFWu6Qrxa/Et0uXsoRnf/Uxu+VYuRChHKmHbYpUU2jl6q31FuDR7WdAmZz3sTK02564I8BF2QisjgcyAXAAVVBIBhYNeS SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;DB7PR08MB3258;20:iAStWihUt1wZymZW84Js8SD4jKXsiI8iKDU+blVON8MdMOvJiQn2/aqseUTzRYXJhul373J63uJbzTaNi+S0NFpd0FvOo+I/aFd5arbB6qC0NCTXzkTPhzLL9nZx0TOGy+kOi7LFNxBsVqu72IqPMKPVzea9xoZtLNznRfY3PKE= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Sep 2018 16:03:34.9548 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d357a21a-673e-42e2-1707-08d61f129ed5 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3258 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Kirill noticed that the following piece of code from md_alloc(dev, name) is dead: if (name && dev) /* * Creating /dev/mdNNN via "newarray", so adjust hold_active. */ mddev->hold_active = UNTIL_STOP; md_alloc() is always called with either dev == 0 or name == NULL. Judging from the commit that added this code: 039b7225e6e98783a7a7e79c52b29c437f29967d Author: NeilBrown Date: Wed Apr 12 16:26:13 2017 +1000 md: allow creation of mdNNN arrays via md_mod/parameters/new_array and from the comment, it seems should be "if (!name && dev)". But that would also change ->hold_active for created-by-open md devices, and I'm not sure whether that would be a desirable change or not.