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 branch 'for-linus' of git://git.kernel.dk/linux-block

Pull block layer fixes from Jens Axboe:
"Two smaller fixes for this cycle:

- A fixup from Keith so that NVMe compiles without BLK_INTEGRITY,
basically just moving the code around appropriately.

- A fixup for shm, fixing an oops in shmem_mapping() for mapping with
no inode. From Sasha"

[ The shmem fix doesn't look block-layer-related, but fixes a bug that
happened due to the backing_dev_info removal.. - Linus ]

* 'for-linus' of git://git.kernel.dk/linux-block:
mm: shmem: check for mapping owner before dereferencing
NVMe: Fix for BLK_DEV_INTEGRITY not set

+61 -41
+58 -41
drivers/block/nvme-core.c
··· 482 482 } 483 483 } 484 484 485 + #ifdef CONFIG_BLK_DEV_INTEGRITY 485 486 static void nvme_dif_prep(u32 p, u32 v, struct t10_pi_tuple *pi) 486 487 { 487 488 if (be32_to_cpu(pi->ref_tag) == v) ··· 538 537 } 539 538 kunmap_atomic(pmap); 540 539 } 540 + 541 + static int nvme_noop_verify(struct blk_integrity_iter *iter) 542 + { 543 + return 0; 544 + } 545 + 546 + static int nvme_noop_generate(struct blk_integrity_iter *iter) 547 + { 548 + return 0; 549 + } 550 + 551 + struct blk_integrity nvme_meta_noop = { 552 + .name = "NVME_META_NOOP", 553 + .generate_fn = nvme_noop_generate, 554 + .verify_fn = nvme_noop_verify, 555 + }; 556 + 557 + static void nvme_init_integrity(struct nvme_ns *ns) 558 + { 559 + struct blk_integrity integrity; 560 + 561 + switch (ns->pi_type) { 562 + case NVME_NS_DPS_PI_TYPE3: 563 + integrity = t10_pi_type3_crc; 564 + break; 565 + case NVME_NS_DPS_PI_TYPE1: 566 + case NVME_NS_DPS_PI_TYPE2: 567 + integrity = t10_pi_type1_crc; 568 + break; 569 + default: 570 + integrity = nvme_meta_noop; 571 + break; 572 + } 573 + integrity.tuple_size = ns->ms; 574 + blk_integrity_register(ns->disk, &integrity); 575 + blk_queue_max_integrity_segments(ns->queue, 1); 576 + } 577 + #else /* CONFIG_BLK_DEV_INTEGRITY */ 578 + static void nvme_dif_remap(struct request *req, 579 + void (*dif_swap)(u32 p, u32 v, struct t10_pi_tuple *pi)) 580 + { 581 + } 582 + static void nvme_dif_prep(u32 p, u32 v, struct t10_pi_tuple *pi) 583 + { 584 + } 585 + static void nvme_dif_complete(u32 p, u32 v, struct t10_pi_tuple *pi) 586 + { 587 + } 588 + static void nvme_init_integrity(struct nvme_ns *ns) 589 + { 590 + } 591 + #endif 541 592 542 593 static void req_completion(struct nvme_queue *nvmeq, void *ctx, 543 594 struct nvme_completion *cqe) ··· 2012 1959 queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, ns->queue); 2013 1960 } 2014 1961 2015 - static int nvme_noop_verify(struct blk_integrity_iter *iter) 2016 - { 2017 - return 0; 2018 - } 2019 - 2020 - static int nvme_noop_generate(struct blk_integrity_iter *iter) 2021 - { 2022 - return 0; 2023 - } 2024 - 2025 - struct blk_integrity nvme_meta_noop = { 2026 - .name = "NVME_META_NOOP", 2027 - .generate_fn = nvme_noop_generate, 2028 - .verify_fn = nvme_noop_verify, 2029 - }; 2030 - 2031 - static void nvme_init_integrity(struct nvme_ns *ns) 2032 - { 2033 - struct blk_integrity integrity; 2034 - 2035 - switch (ns->pi_type) { 2036 - case NVME_NS_DPS_PI_TYPE3: 2037 - integrity = t10_pi_type3_crc; 2038 - break; 2039 - case NVME_NS_DPS_PI_TYPE1: 2040 - case NVME_NS_DPS_PI_TYPE2: 2041 - integrity = t10_pi_type1_crc; 2042 - break; 2043 - default: 2044 - integrity = nvme_meta_noop; 2045 - break; 2046 - } 2047 - integrity.tuple_size = ns->ms; 2048 - blk_integrity_register(ns->disk, &integrity); 2049 - blk_queue_max_integrity_segments(ns->queue, 1); 2050 - } 2051 - 2052 1962 static int nvme_revalidate_disk(struct gendisk *disk) 2053 1963 { 2054 1964 struct nvme_ns *ns = disk->private_data; ··· 2052 2036 pi_type = ns->ms == sizeof(struct t10_pi_tuple) ? 2053 2037 id->dps & NVME_NS_DPS_PI_MASK : 0; 2054 2038 2055 - if (disk->integrity && (ns->pi_type != pi_type || ns->ms != old_ms || 2039 + if (blk_get_integrity(disk) && (ns->pi_type != pi_type || 2040 + ns->ms != old_ms || 2056 2041 bs != queue_logical_block_size(disk->queue) || 2057 2042 (ns->ms && id->flbas & NVME_NS_FLBAS_META_EXT))) 2058 2043 blk_integrity_unregister(disk); ··· 2061 2044 ns->pi_type = pi_type; 2062 2045 blk_queue_logical_block_size(ns->queue, bs); 2063 2046 2064 - if (ns->ms && !disk->integrity && (disk->flags & GENHD_FL_UP) && 2047 + if (ns->ms && !blk_get_integrity(disk) && (disk->flags & GENHD_FL_UP) && 2065 2048 !(id->flbas & NVME_NS_FLBAS_META_EXT)) 2066 2049 nvme_init_integrity(ns); 2067 2050 2068 - if (id->ncap == 0 || (ns->ms && !disk->integrity)) 2051 + if (id->ncap == 0 || (ns->ms && !blk_get_integrity(disk))) 2069 2052 set_capacity(disk, 0); 2070 2053 else 2071 2054 set_capacity(disk, le64_to_cpup(&id->nsze) << (ns->lba_shift - 9)); ··· 2669 2652 2670 2653 list_for_each_entry(ns, &dev->namespaces, list) { 2671 2654 if (ns->disk->flags & GENHD_FL_UP) { 2672 - if (ns->disk->integrity) 2655 + if (blk_get_integrity(ns->disk)) 2673 2656 blk_integrity_unregister(ns->disk); 2674 2657 del_gendisk(ns->disk); 2675 2658 }
+3
mm/shmem.c
··· 1455 1455 1456 1456 bool shmem_mapping(struct address_space *mapping) 1457 1457 { 1458 + if (!mapping->host) 1459 + return false; 1460 + 1458 1461 return mapping->host->i_sb->s_op == &shmem_ops; 1459 1462 } 1460 1463