Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'block-6.11-20240823' of git://git.kernel.dk/linux

Pull block fixes from Jens Axboe:

- NVMe pull request via Keith
- Remove unused struct field (Nilay)
- Fix fabrics keep-alive teardown order (Ming)

- Write zeroes fixes (John)

* tag 'block-6.11-20240823' of git://git.kernel.dk/linux:
nvme: Remove unused field
nvme: move stopping keep-alive into nvme_uninit_ctrl()
block: Drop NULL check in bdev_write_zeroes_sectors()
block: Read max write zeroes once for __blkdev_issue_write_zeroes()

+20 -15
+18 -7
block/blk-lib.c
··· 111 111 (UINT_MAX >> SECTOR_SHIFT) & ~bs_mask); 112 112 } 113 113 114 + /* 115 + * There is no reliable way for the SCSI subsystem to determine whether a 116 + * device supports a WRITE SAME operation without actually performing a write 117 + * to media. As a result, write_zeroes is enabled by default and will be 118 + * disabled if a zeroing operation subsequently fails. This means that this 119 + * queue limit is likely to change at runtime. 120 + */ 114 121 static void __blkdev_issue_write_zeroes(struct block_device *bdev, 115 122 sector_t sector, sector_t nr_sects, gfp_t gfp_mask, 116 - struct bio **biop, unsigned flags) 123 + struct bio **biop, unsigned flags, sector_t limit) 117 124 { 125 + 118 126 while (nr_sects) { 119 - unsigned int len = min_t(sector_t, nr_sects, 120 - bio_write_zeroes_limit(bdev)); 127 + unsigned int len = min(nr_sects, limit); 121 128 struct bio *bio; 122 129 123 130 if ((flags & BLKDEV_ZERO_KILLABLE) && ··· 148 141 static int blkdev_issue_write_zeroes(struct block_device *bdev, sector_t sector, 149 142 sector_t nr_sects, gfp_t gfp, unsigned flags) 150 143 { 144 + sector_t limit = bio_write_zeroes_limit(bdev); 151 145 struct bio *bio = NULL; 152 146 struct blk_plug plug; 153 147 int ret = 0; 154 148 155 149 blk_start_plug(&plug); 156 - __blkdev_issue_write_zeroes(bdev, sector, nr_sects, gfp, &bio, flags); 150 + __blkdev_issue_write_zeroes(bdev, sector, nr_sects, gfp, &bio, 151 + flags, limit); 157 152 if (bio) { 158 153 if ((flags & BLKDEV_ZERO_KILLABLE) && 159 154 fatal_signal_pending(current)) { ··· 174 165 * on an I/O error, in which case we'll turn any error into 175 166 * "not supported" here. 176 167 */ 177 - if (ret && !bdev_write_zeroes_sectors(bdev)) 168 + if (ret && !limit) 178 169 return -EOPNOTSUPP; 179 170 return ret; 180 171 } ··· 274 265 sector_t nr_sects, gfp_t gfp_mask, struct bio **biop, 275 266 unsigned flags) 276 267 { 268 + sector_t limit = bio_write_zeroes_limit(bdev); 269 + 277 270 if (bdev_read_only(bdev)) 278 271 return -EPERM; 279 272 280 - if (bdev_write_zeroes_sectors(bdev)) { 273 + if (limit) { 281 274 __blkdev_issue_write_zeroes(bdev, sector, nr_sects, 282 - gfp_mask, biop, flags); 275 + gfp_mask, biop, flags, limit); 283 276 } else { 284 277 if (flags & BLKDEV_ZERO_NOFALLBACK) 285 278 return -EOPNOTSUPP;
+1 -1
drivers/nvme/host/core.c
··· 4612 4612 { 4613 4613 nvme_mpath_stop(ctrl); 4614 4614 nvme_auth_stop(ctrl); 4615 - nvme_stop_keep_alive(ctrl); 4616 4615 nvme_stop_failfast_work(ctrl); 4617 4616 flush_work(&ctrl->async_event_work); 4618 4617 cancel_work_sync(&ctrl->fw_act_work); ··· 4647 4648 4648 4649 void nvme_uninit_ctrl(struct nvme_ctrl *ctrl) 4649 4650 { 4651 + nvme_stop_keep_alive(ctrl); 4650 4652 nvme_hwmon_exit(ctrl); 4651 4653 nvme_fault_inject_fini(&ctrl->fault_inject); 4652 4654 dev_pm_qos_hide_latency_tolerance(ctrl->device);
-1
drivers/nvme/host/nvme.h
··· 301 301 302 302 struct opal_dev *opal_dev; 303 303 304 - char name[12]; 305 304 u16 cntlid; 306 305 307 306 u16 mtfa;
+1 -6
include/linux/blkdev.h
··· 1296 1296 1297 1297 static inline unsigned int bdev_write_zeroes_sectors(struct block_device *bdev) 1298 1298 { 1299 - struct request_queue *q = bdev_get_queue(bdev); 1300 - 1301 - if (q) 1302 - return q->limits.max_write_zeroes_sectors; 1303 - 1304 - return 0; 1299 + return bdev_get_queue(bdev)->limits.max_write_zeroes_sectors; 1305 1300 } 1306 1301 1307 1302 static inline bool bdev_nonrot(struct block_device *bdev)