public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: Jens Axboe <axboe@kernel.dk>
Cc: Christoph Hellwig <hch@lst.de>,
	linux-block@vger.kernel.org, Hannes Reinecke <hare@suse.de>
Subject: [PATCH 0/6] genhd: register default groups with device_add_disk()
Date: Mon, 30 Jul 2018 09:12:21 +0200	[thread overview]
Message-ID: <20180730071227.22887-1-hare@suse.de> (raw)

device_add_disk() doesn't allow to register with default sysfs groups,
which introduces a race with udev as these groups have to be created after
the uevent has been sent.
This patchset updates device_add_disk() to accept a 'groups' argument to
avoid this race and updates the obvious drivers to use it.
There are some more drivers which might benefit from this (eg loop or md),
but the interface is not straightforward so I haven't attempted it.

As usual, comments and reviews are welcome.

Hannes Reinecke (6):
  genhd: drop 'bool' argument from __device_add_disk()
  block: genhd: add 'groups' argument to device_add_disk
  nvme: register ns_id attributes as default sysfs groups
  aoe: use device_add_disk_with_groups()
  zram: register default groups with device_add_disk()
  virtio-blk: modernize sysfs attribute creation

 arch/um/drivers/ubd_kern.c          |  2 +-
 block/genhd.c                       | 39 ++++++++++++++-------
 drivers/block/aoe/aoe.h             |  1 -
 drivers/block/aoe/aoeblk.c          | 21 ++++--------
 drivers/block/aoe/aoedev.c          |  1 -
 drivers/block/floppy.c              |  2 +-
 drivers/block/mtip32xx/mtip32xx.c   |  2 +-
 drivers/block/ps3disk.c             |  2 +-
 drivers/block/ps3vram.c             |  2 +-
 drivers/block/rsxx/dev.c            |  2 +-
 drivers/block/skd_main.c            |  2 +-
 drivers/block/sunvdc.c              |  2 +-
 drivers/block/virtio_blk.c          | 68 +++++++++++++++++++++----------------
 drivers/block/xen-blkfront.c        |  2 +-
 drivers/block/zram/zram_drv.c       | 28 ++++-----------
 drivers/ide/ide-cd.c                |  2 +-
 drivers/ide/ide-gd.c                |  2 +-
 drivers/memstick/core/ms_block.c    |  2 +-
 drivers/memstick/core/mspro_block.c |  2 +-
 drivers/mmc/core/block.c            |  2 +-
 drivers/mtd/mtd_blkdevs.c           |  2 +-
 drivers/nvdimm/blk.c                |  2 +-
 drivers/nvdimm/btt.c                |  2 +-
 drivers/nvdimm/pmem.c               |  2 +-
 drivers/nvme/host/core.c            | 13 ++++---
 drivers/nvme/host/multipath.c       | 15 +++-----
 drivers/nvme/host/nvme.h            |  2 +-
 drivers/s390/block/dasd_genhd.c     |  2 +-
 drivers/s390/block/dcssblk.c        |  2 +-
 drivers/s390/block/scm_blk.c        |  2 +-
 drivers/scsi/sd.c                   |  2 +-
 drivers/scsi/sr.c                   |  2 +-
 include/linux/genhd.h               |  5 +--
 33 files changed, 117 insertions(+), 122 deletions(-)

-- 
2.12.3

             reply	other threads:[~2018-07-30  7:12 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-30  7:12 Hannes Reinecke [this message]
2018-07-30  7:12 ` [PATCH 1/6] genhd: drop 'bool' argument from __device_add_disk() Hannes Reinecke
2018-07-30  8:56   ` Christoph Hellwig
2018-07-30  8:57     ` Hannes Reinecke
2018-08-13 19:53       ` Bart Van Assche
2018-07-30  7:12 ` [PATCH 2/6] block: genhd: add 'groups' argument to device_add_disk Hannes Reinecke
2018-07-30  8:57   ` Christoph Hellwig
2018-07-30  7:12 ` [PATCH 3/6] nvme: register ns_id attributes as default sysfs groups Hannes Reinecke
2018-07-30  8:59   ` Christoph Hellwig
2018-08-13 19:51   ` Bart Van Assche
2018-08-14  6:19     ` Hannes Reinecke
2018-07-30  7:12 ` [PATCH 4/6] aoe: use device_add_disk_with_groups() Hannes Reinecke
2018-07-30  9:01   ` Christoph Hellwig
2018-08-01  1:00   ` Ed Cashin
2018-08-01  6:57     ` Hannes Reinecke
2018-08-02 11:55       ` Ed Cashin
2018-07-30  7:12 ` [PATCH 5/6] zram: register default groups with device_add_disk() Hannes Reinecke
2018-07-30  9:02   ` Christoph Hellwig
2018-07-30  7:12 ` [PATCH 6/6] virtio-blk: modernize sysfs attribute creation Hannes Reinecke
2018-07-30  9:03   ` Christoph Hellwig
2018-07-31 15:11   ` Michael S. Tsirkin
2018-07-31 15:19     ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180730071227.22887-1-hare@suse.de \
    --to=hare@suse.de \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox