Skip to content

genhd: implement device_add_disk_with_groups()

Hannes Reinecke linux-block linux-nvme 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5genhd: drop 'bool' argument from __device_add_disk()block/genhd.c+11 -71 reply
2/5block: genhd: add device_add_disk_with_groupsblock/genhd.c include/linux/genhd.h+26 -52 replies
3/5nvme: register ns_id attributes as default sysfs groupsdrivers/nvme/host/core.c drivers/nvme/host/multipath.c drivers/nvme/host/nvme.h+11 -170 replies
4/5aoe: use device_add_disk_with_groups()drivers/block/aoe/aoe.h drivers/block/aoe/aoeblk.c drivers/block/aoe/aoedev.c+7 -160 replies
5/5zram: use device_add_disk_with_groups()drivers/block/zram/zram_drv.c+7 -210 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/5] genhd: implement device_add_disk_with_groups()

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(-)
Signature · 1 line
2.12.3