|
|
Subscribe / Log in / New account

Diskseq support in device-mapper

From:  Demi Marie Obenour <demi-AT-invisiblethingslab.com>
To:  Alasdair Kergon <agk-AT-redhat.com>, Mike Snitzer <snitzer-AT-kernel.org>, dm-devel-AT-redhat.com
Subject:  [PATCH v2 0/4] Diskseq support in device-mapper
Date:  Sat, 24 Jun 2023 19:09:43 -0400
Message-ID:  <20230624230950.2272-1-demi@invisiblethingslab.com>
Cc:  Demi Marie Obenour <demi-AT-invisiblethingslab.com>, linux-kernel-AT-vger.kernel.org
Archive-link:  Article

This work aims to allow userspace to create and destroy device-mapper
devices in a race-free way.

Changes since v1:

- Potentially backwards-incompatible changes to device-mapper now
  require userspace opt-in.
- The code has been tested: I have a block script written in C that uses
  these changes to successfully boot a Xen VM.
- The core block layer is completely untouched.  Instead of exposing a
  block device inode directly to userspace, device-mapper ioctls that
  create a block device now return that device's diskseq.  Userspace can
  then use that diskseq to safely open the device.  Furthermore, ioctls
  that operate on an existing device-mapper device now accept a diskseq
  parameter, which can be used to prevent races.

Demi Marie Obenour (4):
  dm ioctl: Allow userspace to opt-in to strict parameter checks
  dm ioctl: Allow userspace to provide expected diskseq
  dm ioctl: Allow userspace to suppress uevent generation
  dm ioctl: inform caller about already-existing device

 drivers/md/dm-core.h          |   2 +
 drivers/md/dm-ioctl.c         | 351 ++++++++++++++++++++++++++++------
 drivers/md/dm.c               |   5 +-
 include/linux/device-mapper.h |   2 +-
 include/uapi/linux/dm-ioctl.h |  90 ++++++++-
 5 files changed, 382 insertions(+), 68 deletions(-)

-- 
Sincerely,
Demi Marie Obenour (she/her/hers)
Invisible Things Lab



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