[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250725-vfs-integrity-d16cb92bb424@brauner>
Date: Fri, 25 Jul 2025 13:27:19 +0200
From: Christian Brauner <brauner@...nel.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Christian Brauner <brauner@...nel.org>,
linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [GIT PULL 11/14 for v6.17] vfs integrity
Hey Linus,
/* Summary */
This adds the new FS_IOC_GETLBMD_CAP ioctl() to query metadata and
protection info (PI) capabilities. This ioctl returns information about
the files integrity profile. This is useful for userspace applications
to understand a files end-to-end data protection support and configure
the I/O accordingly.
For now this interface is only supported by block devices. However the
design and placement of this ioctl in generic FS ioctl space allows us
to extend it to work over files as well. This maybe useful when
filesystems start supporting PI-aware layouts.
A new structure struct logical_block_metadata_cap is introduced, which
contains the following fields:
- lbmd_flags:
bitmask of logical block metadata capability flags
- lbmd_interval:
the amount of data described by each unit of logical block metadata
- lbmd_size:
size in bytes of the logical block metadata associated with each
interval
- lbmd_opaque_size:
size in bytes of the opaque block tag associated with each interval
- lbmd_opaque_offset:
offset in bytes of the opaque block tag within the logical block
metadata
- lbmd_pi_size:
size in bytes of the T10 PI tuple associated with each interval
- lbmd_pi_offset:
offset in bytes of T10 PI tuple within the logical block metadata
- lbmd_pi_guard_tag_type:
T10 PI guard tag type
- lbmd_pi_app_tag_size:
size in bytes of the T10 PI application tag
- lbmd_pi_ref_tag_size:
size in bytes of the T10 PI reference tag
- lbmd_pi_storage_tag_size:
size in bytes of the T10 PI storage tag
The internal logic to fetch the capability is encapsulated in a helper
function blk_get_meta_cap(), which uses the blk_integrity profile
associated with the device. The ioctl returns -EOPNOTSUPP, if
CONFIG_BLK_DEV_INTEGRITY is not enabled.
/* Testing */
gcc (Debian 14.2.0-19) 14.2.0
Debian clang version 19.1.7 (3)
No build failures or warnings were observed.
/* Conflicts */
Merge conflicts with mainline
=============================
No known conflicts.
Merge conflicts with other trees
================================
No known conflicts.
The following changes since commit 19272b37aa4f83ca52bdf9c16d5d81bdd1354494:
Linux 6.16-rc1 (2025-06-08 13:44:43 -0700)
are available in the Git repository at:
git@...olite.kernel.org:pub/scm/linux/kernel/git/vfs/vfs tags/vfs-6.17-rc1.integrity
for you to fetch changes up to bc5b0c8febccbeabfefc9b59083b223ec7c7b53a:
block: fix lbmd_guard_tag_type assignment in FS_IOC_GETLBMD_CAP (2025-07-23 14:55:51 +0200)
Please consider pulling these changes from the signed vfs-6.17-rc1.integrity tag.
Thanks!
Christian
----------------------------------------------------------------
vfs-6.17-rc1.integrity
----------------------------------------------------------------
Anuj Gupta (5):
block: rename tuple_size field in blk_integrity to metadata_size
block: introduce pi_tuple_size field in blk_integrity
nvme: set pi_offset only when checksum type is not BLK_INTEGRITY_CSUM_NONE
fs: add ioctl to query metadata and protection info capabilities
block: fix lbmd_guard_tag_type assignment in FS_IOC_GETLBMD_CAP
Arnd Bergmann (1):
block: fix FS_IOC_GETLBMD_CAP parsing in blkdev_common_ioctl()
Christian Brauner (1):
Merge patch series "add ioctl to query metadata and protection info capabilities"
block/bio-integrity-auto.c | 4 +--
block/blk-integrity.c | 70 ++++++++++++++++++++++++++++++++++++++-
block/blk-settings.c | 44 ++++++++++++++++++++++--
block/ioctl.c | 6 ++++
block/t10-pi.c | 16 ++++-----
drivers/md/dm-crypt.c | 4 +--
drivers/md/dm-integrity.c | 12 +++----
drivers/nvdimm/btt.c | 2 +-
drivers/nvme/host/core.c | 7 ++--
drivers/nvme/target/io-cmd-bdev.c | 2 +-
drivers/scsi/sd_dif.c | 3 +-
include/linux/blk-integrity.h | 11 ++++--
include/linux/blkdev.h | 3 +-
include/uapi/linux/fs.h | 59 +++++++++++++++++++++++++++++++++
14 files changed, 213 insertions(+), 30 deletions(-)
Powered by blists - more mailing lists