linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv4 0/5] genhd: register default groups with device_add_disk()
@ 2018-09-28  6:17 Hannes Reinecke
  2018-09-28  6:17 ` [PATCH 1/5] block: genhd: add 'groups' argument to device_add_disk Hannes Reinecke
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Hannes Reinecke @ 2018-09-28  6:17 UTC (permalink / 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.

Changes to v3:
- Better check in is_visible for lightnvm attributes as suggested
  by hch
  
Changes to v2:
- Fold lightnvm attributes into the generic attribute group as
  suggested by Bart

Changes to v1:
- Drop first patch
- Convert lightnvm sysfs attributes as suggested by Bart

Hannes Reinecke (5):
  block: genhd: add 'groups' argument to device_add_disk
  nvme: register ns_id attributes as default sysfs groups
  aoe: register default groups with device_add_disk()
  zram: register default groups with device_add_disk()
  virtio-blk: modernize sysfs attribute creation

 arch/um/drivers/ubd_kern.c          |   2 +-
 block/genhd.c                       |  19 +++++--
 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            |  21 ++++----
 drivers/nvme/host/lightnvm.c        | 105 +++++++++++++++---------------------
 drivers/nvme/host/multipath.c       |  15 ++----
 drivers/nvme/host/nvme.h            |  10 +---
 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 +-
 34 files changed, 152 insertions(+), 188 deletions(-)

-- 
2.16.4

^ permalink raw reply	[flat|nested] 12+ messages in thread
* [PATCHv3 0/5] genhd: register default groups with device_add_disk()
@ 2018-09-05  7:00 Hannes Reinecke
  2018-09-05  7:00 ` [PATCH 4/5] zram: " Hannes Reinecke
  0 siblings, 1 reply; 12+ messages in thread
From: Hannes Reinecke @ 2018-09-05  7:00 UTC (permalink / 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.

Changes to v2:
- Fold lightnvm attributes into the generic attribute group as
  suggested by Bart

Changes to v1:
- Drop first patch
- Convert lightnvm sysfs attributes as suggested by Bart

Hannes Reinecke (5):
  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                       |  19 +++++--
 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            |  21 +++----
 drivers/nvme/host/lightnvm.c        | 106 +++++++++++++++---------------------
 drivers/nvme/host/multipath.c       |  15 ++---
 drivers/nvme/host/nvme.h            |  10 +---
 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 +-
 34 files changed, 151 insertions(+), 190 deletions(-)

-- 
2.16.4

^ permalink raw reply	[flat|nested] 12+ messages in thread
* [PATCHv2 0/5] genhd: register default groups with device_add_disk()
@ 2018-08-14  7:33 Hannes Reinecke
  2018-08-14  7:33 ` [PATCH 4/5] zram: " Hannes Reinecke
  0 siblings, 1 reply; 12+ messages in thread
From: Hannes Reinecke @ 2018-08-14  7:33 UTC (permalink / 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.

Patches are relative to Christophs nvme-4.19 branch.

As usual, comments and reviews are welcome.

Changes to v1:
- Drop first patch
- Convert lightnvm sysfs attributes as suggested by Bart

Hannes Reinecke (5):
  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                       | 19 ++++++++---
 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            | 21 +++++-------
 drivers/nvme/host/lightnvm.c        | 27 +++------------
 drivers/nvme/host/multipath.c       | 15 +++-----
 drivers/nvme/host/nvme.h            | 11 ++----
 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 +--
 34 files changed, 113 insertions(+), 150 deletions(-)

-- 
2.12.3

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2018-09-28 15:17 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-28  6:17 [PATCHv4 0/5] genhd: register default groups with device_add_disk() Hannes Reinecke
2018-09-28  6:17 ` [PATCH 1/5] block: genhd: add 'groups' argument to device_add_disk Hannes Reinecke
2018-09-28  6:17 ` [PATCH 2/5] nvme: register ns_id attributes as default sysfs groups Hannes Reinecke
2018-09-28 14:15   ` Keith Busch
2018-09-28 15:17   ` Christoph Hellwig
2018-09-28  6:17 ` [PATCH 3/5] aoe: register default groups with device_add_disk() Hannes Reinecke
2018-09-28  6:17 ` [PATCH 4/5] zram: " Hannes Reinecke
2018-09-28  6:17 ` [PATCH 5/5] virtio-blk: modernize sysfs attribute creation Hannes Reinecke
2018-09-28 14:30 ` [PATCHv4 0/5] genhd: register default groups with device_add_disk() Jens Axboe
  -- strict thread matches above, loose matches on Subject: below --
2018-09-05  7:00 [PATCHv3 " Hannes Reinecke
2018-09-05  7:00 ` [PATCH 4/5] zram: " Hannes Reinecke
2018-08-14  7:33 [PATCHv2 0/5] genhd: " Hannes Reinecke
2018-08-14  7:33 ` [PATCH 4/5] zram: " Hannes Reinecke
2018-08-14 15:23   ` Bart Van Assche

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).