]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
Merge tag 'vfs-6.17-rc1.integrity' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 28 Jul 2025 22:12:00 +0000 (15:12 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 28 Jul 2025 22:12:00 +0000 (15:12 -0700)
Pull vfs 'protection info' updates from Christian Brauner:
 "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"

* tag 'vfs-6.17-rc1.integrity' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs:
  block: fix lbmd_guard_tag_type assignment in FS_IOC_GETLBMD_CAP
  block: fix FS_IOC_GETLBMD_CAP parsing in blkdev_common_ioctl()
  fs: add ioctl to query metadata and protection info capabilities
  nvme: set pi_offset only when checksum type is not BLK_INTEGRITY_CSUM_NONE
  block: introduce pi_tuple_size field in blk_integrity
  block: rename tuple_size field in blk_integrity to metadata_size

1  2 
block/blk-settings.c
block/ioctl.c
drivers/md/dm-crypt.c
drivers/nvme/host/core.c
drivers/nvme/target/io-cmd-bdev.c
include/linux/blkdev.h
include/uapi/linux/fs.h

Simple merge
diff --cc block/ioctl.c
index e472cc1030c60ce20ffc6fa1c2953bd5cf47602d,af2e22e5533c41865dd5051161af5b6b443debff..f7b0006ca45d775d5bb56a5f7382c1836e44a6bc
@@@ -644,7 -650,7 +645,7 @@@ static int blkdev_common_ioctl(struct b
        case IOC_PR_CLEAR:
                return blkdev_pr_clear(bdev, mode, argp);
        default:
--              return -ENOIOCTLCMD;
++              return blk_get_meta_cap(bdev, cmd, argp);
        }
  }
  
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge