mbox series

[v2,0/6] block: add a sequence number to disks

Message ID 20210520135622.44625-1-mcroce@linux.microsoft.com (mailing list archive)
Headers show
Series block: add a sequence number to disks | expand

Message

Matteo Croce May 20, 2021, 1:56 p.m. UTC
From: Matteo Croce <mcroce@microsoft.com>

With this series a monotonically increasing number is added to disks,
precisely in the genhd struct, and it's exported in sysfs and uevent.

This helps the userspace correlate events for devices that reuse the
same device, like loop.

The first patch is the core one, the 2..4 expose the information in
different ways, the 5th increases the seqnum on media change and
the last one increases the sequence number for loop devices upon
attach, detach or reconfigure.

If merged, this feature will immediately used by the userspace:
https://github.com/systemd/systemd/issues/17469#issuecomment-762919781

v1 -> v2:
- increase seqnum on media change
- increase on loop detach

Matteo Croce (6):
  block: add disk sequence number
  block: add ioctl to read the disk sequence number
  block: refactor sysfs code
  block: export diskseq in sysfs
  block: increment sequence number
  loop: increment sequence number

 Documentation/ABI/testing/sysfs-block | 12 +++++++
 block/genhd.c                         | 46 ++++++++++++++++++++++++---
 block/ioctl.c                         |  2 ++
 drivers/block/loop.c                  |  5 +++
 include/linux/genhd.h                 |  2 ++
 include/uapi/linux/fs.h               |  1 +
 6 files changed, 64 insertions(+), 4 deletions(-)

Comments

Matteo Croce June 8, 2021, 2:31 p.m. UTC | #1
On Thu, May 20, 2021 at 3:56 PM Matteo Croce <mcroce@linux.microsoft.com> wrote:
>
> From: Matteo Croce <mcroce@microsoft.com>
>
> With this series a monotonically increasing number is added to disks,
> precisely in the genhd struct, and it's exported in sysfs and uevent.
>
> This helps the userspace correlate events for devices that reuse the
> same device, like loop.
>
> The first patch is the core one, the 2..4 expose the information in
> different ways, the 5th increases the seqnum on media change and
> the last one increases the sequence number for loop devices upon
> attach, detach or reconfigure.
>
> If merged, this feature will immediately used by the userspace:
> https://github.com/systemd/systemd/issues/17469#issuecomment-762919781
>

Hi Christoph,

I just noticed that the series doesn't apply anymore. Before
refreshing it, I wish to know what are your opinion on this one, as
nobody expressed one on latest submission.