|
|
Log in / Subscribe / Register

block: add a sequence number to disks

From:  Matteo Croce <mcroce-AT-linux.microsoft.com>
To:  linux-block-AT-vger.kernel.org, linux-fsdevel-AT-vger.kernel.org
Subject:  [PATCH v2 0/6] block: add a sequence number to disks
Date:  Thu, 20 May 2021 15:56:16 +0200
Message-ID:  <20210520135622.44625-1-mcroce@linux.microsoft.com>
Cc:  linux-kernel-AT-vger.kernel.org, Lennart Poettering <lennart-AT-poettering.net>, Luca Boccassi <bluca-AT-debian.org>, Jens Axboe <axboe-AT-kernel.dk>, Alexander Viro <viro-AT-zeniv.linux.org.uk>, Damien Le Moal <damien.lemoal-AT-wdc.com>, Tejun Heo <tj-AT-kernel.org>, Javier González <javier-AT-javigon.com>, Niklas Cassel <niklas.cassel-AT-wdc.com>, Johannes Thumshirn <johannes.thumshirn-AT-wdc.com>, Hannes Reinecke <hare-AT-suse.de>, Matthew Wilcox <willy-AT-infradead.org>, Christoph Hellwig <hch-AT-infradead.org>, JeffleXu <jefflexu-AT-linux.alibaba.com>
Archive-link:  Article

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#issuecomm...

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(-)

-- 
2.31.1



Copyright © 2021, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds