Merge tag 'for-6.11/block-20240710' of git://git.kernel.dk/linux
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 15 Jul 2024 21:20:22 +0000 (14:20 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 15 Jul 2024 21:20:22 +0000 (14:20 -0700)
Pull block updates from Jens Axboe:

 - NVMe updates via Keith:
     - Device initialization memory leak fixes (Keith)
     - More constants defined (Weiwen)
     - Target debugfs support (Hannes)
     - PCIe subsystem reset enhancements (Keith)
     - Queue-depth multipath policy (Redhat and PureStorage)
     - Implement get_unique_id (Christoph)
     - Authentication error fixes (Gaosheng)

 - MD updates via Song
     - sync_action fix and refactoring (Yu Kuai)
     - Various small fixes (Christoph Hellwig, Li Nan, and Ofir Gal, Yu
       Kuai, Benjamin Marzinski, Christophe JAILLET, Yang Li)

 - Fix loop detach/open race (Gulam)

 - Fix lower control limit for blk-throttle (Yu)

 - Add module descriptions to various drivers (Jeff)

 - Add support for atomic writes for block devices, and statx reporting
   for same. Includes SCSI and NVMe (John, Prasad, Alan)

 - Add IO priority information to block trace points (Dongliang)

 - Various zone improvements and tweaks (Damien)

 - mq-deadline tag reservation improvements (Bart)

 - Ignore direct reclaim swap writes in writeback throttling (Baokun)

 - Block integrity improvements and fixes (Anuj)

 - Add basic support for rust based block drivers. Has a dummy null_blk
   variant for now (Andreas)

 - Series converting driver settings to queue limits, and cleanups and
   fixes related to that (Christoph)

 - Cleanup for poking too deeply into the bvec internals, in preparation
   for DMA mapping API changes (Christoph)

 - Various minor tweaks and fixes (Jiapeng, John, Kanchan, Mikulas,
   Ming, Zhu, Damien, Christophe, Chaitanya)

* tag 'for-6.11/block-20240710' of git://git.kernel.dk/linux: (206 commits)
  floppy: add missing MODULE_DESCRIPTION() macro
  loop: add missing MODULE_DESCRIPTION() macro
  ublk_drv: add missing MODULE_DESCRIPTION() macro
  xen/blkback: add missing MODULE_DESCRIPTION() macro
  block/rnbd: Constify struct kobj_type
  block: take offset into account in blk_bvec_map_sg again
  block: fix get_max_segment_size() warning
  loop: Don't bother validating blocksize
  virtio_blk: Don't bother validating blocksize
  null_blk: Don't bother validating blocksize
  block: Validate logical block size in blk_validate_limits()
  virtio_blk: Fix default logical block size fallback
  nvmet-auth: fix nvmet_auth hash error handling
  nvme: implement ->get_unique_id
  block: pass a phys_addr_t to get_max_segment_size
  block: add a bvec_phys helper
  blk-lib: check for kill signal in ioctl BLKZEROOUT
  block: limit the Write Zeroes to manually writing zeroes fallback
  block: refacto blkdev_issue_zeroout
  block: move read-only and supported checks into (__)blkdev_issue_zeroout
  ...

25 files changed:
1  2 
.mailmap
MAINTAINERS
block/bdev.c
block/bio-integrity.c
block/blk-flush.c
block/blk-zoned.c
drivers/ata/libata-scsi.c
drivers/block/loop.c
drivers/block/nbd.c
drivers/nvme/host/apple.c
drivers/nvme/host/core.c
drivers/nvme/host/nvme.h
drivers/nvme/target/core.c
drivers/nvme/target/fabrics-cmd-auth.c
drivers/nvme/target/fabrics-cmd.c
drivers/nvme/target/fc.c
drivers/nvme/target/passthru.c
drivers/scsi/mpt3sas/mpt3sas_scsih.c
drivers/scsi/scsi_debug.c
drivers/scsi/sd.c
drivers/ufs/core/ufshcd.c
fs/stat.c
include/linux/blkdev.h
include/linux/fs.h
include/linux/nvme.h

diff --cc .mailmap
Simple merge
diff --cc MAINTAINERS
Simple merge
diff --cc block/bdev.c
index 353677ac49b3b9677f918340c622918617cee3fd,1b4af2cc3b1e6c86fbfef9d8dcc60e543aa4f189..c5507b6f63b8b13a2a978b9235ccdea9e3a9395b
@@@ -1260,17 -1260,23 +1260,26 @@@ void sync_bdevs(bool wait
  }
  
  /*
-  * Handle STATX_DIOALIGN for block devices.
-  *
-  * Note that the inode passed to this is the inode of a block device node file,
-  * not the block device's internal inode.  Therefore it is *not* valid to use
-  * I_BDEV() here; the block device has to be looked up by i_rdev instead.
+  * Handle STATX_{DIOALIGN, WRITE_ATOMIC} for block devices.
   */
- void bdev_statx_dioalign(struct inode *inode, struct kstat *stat)
 -void bdev_statx(struct inode *backing_inode, struct kstat *stat,
++void bdev_statx(struct path *path, struct kstat *stat,
+               u32 request_mask)
  {
++      struct inode *backing_inode;
        struct block_device *bdev;
  
-       bdev = blkdev_get_no_open(inode->i_rdev);
+       if (!(request_mask & (STATX_DIOALIGN | STATX_WRITE_ATOMIC)))
+               return;
++      backing_inode = d_backing_inode(path->dentry);
++
+       /*
+        * Note that backing_inode is the inode of a block device node file,
+        * not the block device's internal inode.  Therefore it is *not* valid
+        * to use I_BDEV() here; the block device has to be looked up by i_rdev
+        * instead.
+        */
+       bdev = blkdev_get_no_open(backing_inode->i_rdev);
        if (!bdev)
                return;
  
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc fs/stat.c
index 6f65b3456cadb762b1001ab8325f46047130241f,bd0698dfd7b36e01722176bb39024c927dfdb744..89ce1be563108c1bc0ecabaff5b277258eb6c398
+++ b/fs/stat.c
@@@ -214,43 -245,6 +245,43 @@@ int getname_statx_lookup_flags(int flag
        return lookup_flags;
  }
  
-       /* Handle STATX_DIOALIGN for block devices. */
-       if (request_mask & STATX_DIOALIGN) {
-               struct inode *inode = d_backing_inode(path->dentry);
-               if (S_ISBLK(inode->i_mode))
-                       bdev_statx_dioalign(inode, stat);
-       }
 +static int vfs_statx_path(struct path *path, int flags, struct kstat *stat,
 +                        u32 request_mask)
 +{
 +      int error = vfs_getattr(path, stat, request_mask, flags);
 +
 +      if (request_mask & STATX_MNT_ID_UNIQUE) {
 +              stat->mnt_id = real_mount(path->mnt)->mnt_id_unique;
 +              stat->result_mask |= STATX_MNT_ID_UNIQUE;
 +      } else {
 +              stat->mnt_id = real_mount(path->mnt)->mnt_id;
 +              stat->result_mask |= STATX_MNT_ID;
 +      }
 +
 +      if (path_mounted(path))
 +              stat->attributes |= STATX_ATTR_MOUNT_ROOT;
 +      stat->attributes_mask |= STATX_ATTR_MOUNT_ROOT;
 +
++      /*
++       * If this is a block device inode, override the filesystem
++       * attributes with the block device specific parameters that need to be
++       * obtained from the bdev backing inode.
++       */
++      if (S_ISBLK(stat->mode))
++              bdev_statx(path, stat, request_mask);
 +
 +      return error;
 +}
 +
 +static int vfs_statx_fd(int fd, int flags, struct kstat *stat,
 +                        u32 request_mask)
 +{
 +      CLASS(fd_raw, f)(fd);
 +      if (!f.file)
 +              return -EBADF;
 +      return vfs_statx_path(&f.file->f_path, flags, stat, request_mask);
 +}
 +
  /**
   * vfs_statx - Get basic and extra attributes by filename
   * @dfd: A file descriptor representing the base dir for a relative filename
index 24c36929920b76934fe32eea7f95a3808542dcb0,dce4a6bf73070848ca4ae6fa2ef234e4c7dfadcd..b8196e219ac22fa1671658a61e6eafe7bba1f38a
@@@ -1563,7 -1617,8 +1617,7 @@@ int sync_blockdev(struct block_device *
  int sync_blockdev_range(struct block_device *bdev, loff_t lstart, loff_t lend);
  int sync_blockdev_nowait(struct block_device *bdev);
  void sync_bdevs(bool wait);
- void bdev_statx_dioalign(struct inode *inode, struct kstat *stat);
 -void bdev_statx(struct inode *backing_inode, struct kstat *stat,
 -              u32 request_mask);
++void bdev_statx(struct path *, struct kstat *, u32);
  void printk_all_partitions(void);
  int __init early_lookup_bdev(const char *pathname, dev_t *dev);
  #else
@@@ -1581,7 -1636,8 +1635,8 @@@ static inline int sync_blockdev_nowait(
  static inline void sync_bdevs(bool wait)
  {
  }
- static inline void bdev_statx_dioalign(struct inode *inode, struct kstat *stat)
 -static inline void bdev_statx(struct inode *backing_inode, struct kstat *stat,
++static inline void bdev_statx(struct path *path, struct kstat *stat,
+                               u32 request_mask)
  {
  }
  static inline void printk_all_partitions(void)
index dc9f9c4b2572dcf6946a4dd382e58d1b37732620,db26b4a70c628bb8e65b4898886b0803549c330e..fd34b5755c0b52988a7131493cd56fa8ea640ad9
@@@ -3626,21 -3627,6 +3640,23 @@@ extern int vfs_fadvise(struct file *fil
  extern int generic_fadvise(struct file *file, loff_t offset, loff_t len,
                           int advice);
  
 +static inline bool vfs_empty_path(int dfd, const char __user *path)
 +{
 +      char c;
 +
 +      if (dfd < 0)
 +              return false;
 +
 +      /* We now allow NULL to be used for empty path. */
 +      if (!path)
 +              return true;
 +
 +      if (unlikely(get_user(c, path)))
 +              return false;
 +
 +      return !c;
 +}
 +
+ bool generic_atomic_write_valid(struct iov_iter *iter, loff_t pos);
  #endif /* _LINUX_FS_H */
Simple merge