Skip to content

Diskseq support in device-mapper

Demi Marie Obenour dm-devel kernel-janitors linux-block lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest4 patches 17 repliesIn review

Changes in v2 from the cover letter

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

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4dm ioctl: Allow userspace to opt-in to strict parameter checksdrivers/md/dm-ioctl.c include/uapi/linux/dm-ioctl.h+284 -570 replies
2/4dm ioctl: Allow userspace to provide expected diskseqdrivers/md/dm-ioctl.c include/uapi/linux/dm-ioctl.h+63 -99 replies
3/4dm ioctl: Allow userspace to suppress uevent generationdrivers/md/dm-core.h drivers/md/dm-ioctl.c drivers/md/dm.c +2 more+54 -405 replies
4/4dm ioctl: inform caller about already-existing devicedrivers/md/dm-ioctl.c include/uapi/linux/dm-ioctl.h+27 -80 replies

Reviews trailers per patch

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

Read the v2 thread

Cover letter [PATCH v2 0/4] Diskseq support in device-mapper

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(-)
Signature · 3 lines
Sincerely,
Demi Marie Obenour (she/her/hers)
Invisible Things Lab