From patchwork Wed Jul 25 06:28:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Reinecke X-Patchwork-Id: 10543477 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F1BB5139A for ; Wed, 25 Jul 2018 06:28:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9E4762965A for ; Wed, 25 Jul 2018 06:28:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8E9342963E; Wed, 25 Jul 2018 06:28:46 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 828F22963E for ; Wed, 25 Jul 2018 06:28:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728338AbeGYHix (ORCPT ); Wed, 25 Jul 2018 03:38:53 -0400 Received: from mx2.suse.de ([195.135.220.15]:47152 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728073AbeGYHix (ORCPT ); Wed, 25 Jul 2018 03:38:53 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id BE529ACC2; Wed, 25 Jul 2018 06:28:41 +0000 (UTC) From: Hannes Reinecke To: Jens Axboe Cc: Christoph Hellwig , Keith Busch , Sagi Grimberg , linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, Martin Wilck , Hannes Reinecke Subject: [PATCH 0/5] genhd: implement device_add_disk_with_groups() Date: Wed, 25 Jul 2018 08:28:35 +0200 Message-Id: <20180725062840.94114-1-hare@suse.de> X-Mailer: git-send-email 2.12.3 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 When creating a block device some drivers need to create additional sysfs groups to store driver-specific informations. With the current workflow of adding these groups with a separate call to sysfs after the device has been created we are introducing a race with udev, as the uevent is generated before the sysfs attributes are created, and udev fails to read the required information. This patchset adds a new function 'device_add_disk_with_groups()' and converts the obvious candidates to use this new function. As usual, comments and reviews are welcome. Hannes Reinecke (5): genhd: drop 'bool' argument from __device_add_disk() block: genhd: add device_add_disk_with_groups nvme: register ns_id attributes as default sysfs groups aoe: use device_add_disk_with_groups() zram: use device_add_disk_with_groups() block/genhd.c | 38 ++++++++++++++++++++++++++++++-------- drivers/block/aoe/aoe.h | 1 - drivers/block/aoe/aoeblk.c | 21 +++++++-------------- drivers/block/aoe/aoedev.c | 1 - drivers/block/zram/zram_drv.c | 28 +++++++--------------------- drivers/nvme/host/core.c | 14 +++++++------- drivers/nvme/host/multipath.c | 12 +++--------- drivers/nvme/host/nvme.h | 2 +- include/linux/genhd.h | 3 +++ 9 files changed, 58 insertions(+), 62 deletions(-)