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.1-2022-11-18' of git://git.kernel.dk/linux

Pull block fixes from Jens Axboe:

- NVMe pull request via Christoph:
- Two more bogus nid quirks (Bean Huo, Tiago Dias Ferreira)
- Memory leak fix in nvmet (Sagi Grimberg)

- Regression fix for block cgroups pinning the wrong blkcg, causing
leaks of cgroups and blkcgs (Chris)

- UAF fix for drbd setup error handling (Dan)

- Fix DMA alignment propagation in DM (Keith)

* tag 'block-6.1-2022-11-18' of git://git.kernel.dk/linux:
dm-log-writes: set dma_alignment limit in io_hints
dm-integrity: set dma_alignment limit in io_hints
block: make blk_set_default_limits() private
dm-crypt: provide dma_alignment limit in io_hints
block: make dma_alignment a stacking queue_limit
nvmet: fix a memory leak in nvmet_auth_set_key
nvme-pci: add NVME_QUIRK_BOGUS_NID for Netac NV7000
drbd: use after free in drbd_create_device()
nvme-pci: add NVME_QUIRK_BOGUS_NID for Micron Nitro
blk-cgroup: properly pin the parent in blkcg_css_online

+26 -16
+1 -1
block/blk-cgroup.c
··· 1213 1213 * parent so that offline always happens towards the root. 1214 1214 */ 1215 1215 if (parent) 1216 - blkcg_pin_online(css); 1216 + blkcg_pin_online(&parent->css); 1217 1217 return 0; 1218 1218 } 1219 1219
-1
block/blk-core.c
··· 425 425 PERCPU_REF_INIT_ATOMIC, GFP_KERNEL)) 426 426 goto fail_stats; 427 427 428 - blk_queue_dma_alignment(q, 511); 429 428 blk_set_default_limits(&q->limits); 430 429 q->nr_requests = BLKDEV_DEFAULT_RQ; 431 430
+5 -4
block/blk-settings.c
··· 57 57 lim->misaligned = 0; 58 58 lim->zoned = BLK_ZONED_NONE; 59 59 lim->zone_write_granularity = 0; 60 + lim->dma_alignment = 511; 60 61 } 61 - EXPORT_SYMBOL(blk_set_default_limits); 62 62 63 63 /** 64 64 * blk_set_stacking_limits - set default limits for stacking devices ··· 600 600 601 601 t->io_min = max(t->io_min, b->io_min); 602 602 t->io_opt = lcm_not_zero(t->io_opt, b->io_opt); 603 + t->dma_alignment = max(t->dma_alignment, b->dma_alignment); 603 604 604 605 /* Set non-power-of-2 compatible chunk_sectors boundary */ 605 606 if (b->chunk_sectors) ··· 774 773 **/ 775 774 void blk_queue_dma_alignment(struct request_queue *q, int mask) 776 775 { 777 - q->dma_alignment = mask; 776 + q->limits.dma_alignment = mask; 778 777 } 779 778 EXPORT_SYMBOL(blk_queue_dma_alignment); 780 779 ··· 796 795 { 797 796 BUG_ON(mask > PAGE_SIZE); 798 797 799 - if (mask > q->dma_alignment) 800 - q->dma_alignment = mask; 798 + if (mask > q->limits.dma_alignment) 799 + q->limits.dma_alignment = mask; 801 800 } 802 801 EXPORT_SYMBOL(blk_queue_update_dma_alignment); 803 802
+1
block/blk.h
··· 331 331 bool blk_rq_merge_ok(struct request *rq, struct bio *bio); 332 332 enum elv_merge blk_try_merge(struct request *rq, struct bio *bio); 333 333 334 + void blk_set_default_limits(struct queue_limits *lim); 334 335 int blk_dev_init(void); 335 336 336 337 /*
+2 -2
drivers/block/drbd/drbd_main.c
··· 2672 2672 enum drbd_ret_code drbd_create_device(struct drbd_config_context *adm_ctx, unsigned int minor) 2673 2673 { 2674 2674 struct drbd_resource *resource = adm_ctx->resource; 2675 - struct drbd_connection *connection; 2675 + struct drbd_connection *connection, *n; 2676 2676 struct drbd_device *device; 2677 2677 struct drbd_peer_device *peer_device, *tmp_peer_device; 2678 2678 struct gendisk *disk; ··· 2789 2789 return NO_ERROR; 2790 2790 2791 2791 out_idr_remove_from_resource: 2792 - for_each_connection(connection, resource) { 2792 + for_each_connection_safe(connection, n, resource) { 2793 2793 peer_device = idr_remove(&connection->peer_devices, vnr); 2794 2794 if (peer_device) 2795 2795 kref_put(&connection->kref, drbd_destroy_connection);
+1
drivers/md/dm-crypt.c
··· 3630 3630 limits->physical_block_size = 3631 3631 max_t(unsigned, limits->physical_block_size, cc->sector_size); 3632 3632 limits->io_min = max_t(unsigned, limits->io_min, cc->sector_size); 3633 + limits->dma_alignment = limits->logical_block_size - 1; 3633 3634 } 3634 3635 3635 3636 static struct target_type crypt_target = {
+1
drivers/md/dm-integrity.c
··· 3378 3378 limits->logical_block_size = ic->sectors_per_block << SECTOR_SHIFT; 3379 3379 limits->physical_block_size = ic->sectors_per_block << SECTOR_SHIFT; 3380 3380 blk_limits_io_min(limits, ic->sectors_per_block << SECTOR_SHIFT); 3381 + limits->dma_alignment = limits->logical_block_size - 1; 3381 3382 } 3382 3383 } 3383 3384
+1
drivers/md/dm-log-writes.c
··· 875 875 limits->logical_block_size = bdev_logical_block_size(lc->dev->bdev); 876 876 limits->physical_block_size = bdev_physical_block_size(lc->dev->bdev); 877 877 limits->io_min = limits->physical_block_size; 878 + limits->dma_alignment = limits->logical_block_size - 1; 878 879 } 879 880 880 881 #if IS_ENABLED(CONFIG_FS_DAX)
+4
drivers/nvme/host/pci.c
··· 3489 3489 NVME_QUIRK_IGNORE_DEV_SUBNQN, }, 3490 3490 { PCI_DEVICE(0x1344, 0x5407), /* Micron Technology Inc NVMe SSD */ 3491 3491 .driver_data = NVME_QUIRK_IGNORE_DEV_SUBNQN }, 3492 + { PCI_DEVICE(0x1344, 0x6001), /* Micron Nitro NVMe */ 3493 + .driver_data = NVME_QUIRK_BOGUS_NID, }, 3492 3494 { PCI_DEVICE(0x1c5c, 0x1504), /* SK Hynix PC400 */ 3493 3495 .driver_data = NVME_QUIRK_DISABLE_WRITE_ZEROES, }, 3494 3496 { PCI_DEVICE(0x1c5c, 0x174a), /* SK Hynix P31 SSD */ ··· 3521 3519 .driver_data = NVME_QUIRK_DISABLE_WRITE_ZEROES, }, 3522 3520 { PCI_DEVICE(0x2646, 0x501E), /* KINGSTON OM3PGP4xxxxQ OS21011 NVMe SSD */ 3523 3521 .driver_data = NVME_QUIRK_DISABLE_WRITE_ZEROES, }, 3522 + { PCI_DEVICE(0x1f40, 0x5236), /* Netac Technologies Co. NV7000 NVMe SSD */ 3523 + .driver_data = NVME_QUIRK_BOGUS_NID, }, 3524 3524 { PCI_DEVICE(0x1e4B, 0x1001), /* MAXIO MAP1001 */ 3525 3525 .driver_data = NVME_QUIRK_BOGUS_NID, }, 3526 3526 { PCI_DEVICE(0x1e4B, 0x1002), /* MAXIO MAP1002 */
+2
drivers/nvme/target/auth.c
··· 45 45 if (!dhchap_secret) 46 46 return -ENOMEM; 47 47 if (set_ctrl) { 48 + kfree(host->dhchap_ctrl_secret); 48 49 host->dhchap_ctrl_secret = strim(dhchap_secret); 49 50 host->dhchap_ctrl_key_hash = key_hash; 50 51 } else { 52 + kfree(host->dhchap_secret); 51 53 host->dhchap_secret = strim(dhchap_secret); 52 54 host->dhchap_key_hash = key_hash; 53 55 }
+8 -8
include/linux/blkdev.h
··· 311 311 unsigned char discard_misaligned; 312 312 unsigned char raid_partial_stripes_expensive; 313 313 enum blk_zoned_model zoned; 314 + 315 + /* 316 + * Drivers that set dma_alignment to less than 511 must be prepared to 317 + * handle individual bvec's that are not a multiple of a SECTOR_SIZE 318 + * due to possible offsets. 319 + */ 320 + unsigned int dma_alignment; 314 321 }; 315 322 316 323 typedef int (*report_zones_cb)(struct blk_zone *zone, unsigned int idx, ··· 463 456 unsigned long nr_requests; /* Max # of requests */ 464 457 465 458 unsigned int dma_pad_mask; 466 - /* 467 - * Drivers that set dma_alignment to less than 511 must be prepared to 468 - * handle individual bvec's that are not a multiple of a SECTOR_SIZE 469 - * due to possible offsets. 470 - */ 471 - unsigned int dma_alignment; 472 459 473 460 #ifdef CONFIG_BLK_INLINE_ENCRYPTION 474 461 struct blk_crypto_profile *crypto_profile; ··· 945 944 extern void blk_limits_io_opt(struct queue_limits *limits, unsigned int opt); 946 945 extern void blk_queue_io_opt(struct request_queue *q, unsigned int opt); 947 946 extern void blk_set_queue_depth(struct request_queue *q, unsigned int depth); 948 - extern void blk_set_default_limits(struct queue_limits *lim); 949 947 extern void blk_set_stacking_limits(struct queue_limits *lim); 950 948 extern int blk_stack_limits(struct queue_limits *t, struct queue_limits *b, 951 949 sector_t offset); ··· 1324 1324 1325 1325 static inline int queue_dma_alignment(const struct request_queue *q) 1326 1326 { 1327 - return q ? q->dma_alignment : 511; 1327 + return q ? q->limits.dma_alignment : 511; 1328 1328 } 1329 1329 1330 1330 static inline unsigned int bdev_dma_alignment(struct block_device *bdev)