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.org/pub/scm/linux/kernel/git/mason/linux-btrfs

Pull btrfs fixes from Chris Mason:
"Filipe is nailing down some problems with our skinny extent variation,
and Dave's patch fixes endian problems in the new super block checks"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
Btrfs: fix race that makes btrfs_lookup_extent_info miss skinny extent items
Btrfs: properly clean up btrfs_end_io_wq_cache
Btrfs: fix invalid leaf slot access in btrfs_lookup_extent()
btrfs: use macro accessors in superblock validation checks

+27 -39
+1 -1
fs/btrfs/ctree.h
··· 3276 3276 struct btrfs_root *root, unsigned long count); 3277 3277 int btrfs_async_run_delayed_refs(struct btrfs_root *root, 3278 3278 unsigned long count, int wait); 3279 - int btrfs_lookup_extent(struct btrfs_root *root, u64 start, u64 len); 3279 + int btrfs_lookup_data_extent(struct btrfs_root *root, u64 start, u64 len); 3280 3280 int btrfs_lookup_extent_info(struct btrfs_trans_handle *trans, 3281 3281 struct btrfs_root *root, u64 bytenr, 3282 3282 u64 offset, int metadata, u64 *refs, u64 *flags);
+22 -21
fs/btrfs/disk-io.c
··· 3817 3817 struct btrfs_super_block *sb = fs_info->super_copy; 3818 3818 int ret = 0; 3819 3819 3820 - if (sb->root_level > BTRFS_MAX_LEVEL) { 3821 - printk(KERN_ERR "BTRFS: tree_root level too big: %d > %d\n", 3822 - sb->root_level, BTRFS_MAX_LEVEL); 3820 + if (btrfs_super_root_level(sb) >= BTRFS_MAX_LEVEL) { 3821 + printk(KERN_ERR "BTRFS: tree_root level too big: %d >= %d\n", 3822 + btrfs_super_root_level(sb), BTRFS_MAX_LEVEL); 3823 3823 ret = -EINVAL; 3824 3824 } 3825 - if (sb->chunk_root_level > BTRFS_MAX_LEVEL) { 3826 - printk(KERN_ERR "BTRFS: chunk_root level too big: %d > %d\n", 3827 - sb->chunk_root_level, BTRFS_MAX_LEVEL); 3825 + if (btrfs_super_chunk_root_level(sb) >= BTRFS_MAX_LEVEL) { 3826 + printk(KERN_ERR "BTRFS: chunk_root level too big: %d >= %d\n", 3827 + btrfs_super_chunk_root_level(sb), BTRFS_MAX_LEVEL); 3828 3828 ret = -EINVAL; 3829 3829 } 3830 - if (sb->log_root_level > BTRFS_MAX_LEVEL) { 3831 - printk(KERN_ERR "BTRFS: log_root level too big: %d > %d\n", 3832 - sb->log_root_level, BTRFS_MAX_LEVEL); 3830 + if (btrfs_super_log_root_level(sb) >= BTRFS_MAX_LEVEL) { 3831 + printk(KERN_ERR "BTRFS: log_root level too big: %d >= %d\n", 3832 + btrfs_super_log_root_level(sb), BTRFS_MAX_LEVEL); 3833 3833 ret = -EINVAL; 3834 3834 } 3835 3835 ··· 3837 3837 * The common minimum, we don't know if we can trust the nodesize/sectorsize 3838 3838 * items yet, they'll be verified later. Issue just a warning. 3839 3839 */ 3840 - if (!IS_ALIGNED(sb->root, 4096)) 3840 + if (!IS_ALIGNED(btrfs_super_root(sb), 4096)) 3841 3841 printk(KERN_WARNING "BTRFS: tree_root block unaligned: %llu\n", 3842 3842 sb->root); 3843 - if (!IS_ALIGNED(sb->chunk_root, 4096)) 3843 + if (!IS_ALIGNED(btrfs_super_chunk_root(sb), 4096)) 3844 3844 printk(KERN_WARNING "BTRFS: tree_root block unaligned: %llu\n", 3845 3845 sb->chunk_root); 3846 - if (!IS_ALIGNED(sb->log_root, 4096)) 3846 + if (!IS_ALIGNED(btrfs_super_log_root(sb), 4096)) 3847 3847 printk(KERN_WARNING "BTRFS: tree_root block unaligned: %llu\n", 3848 - sb->log_root); 3848 + btrfs_super_log_root(sb)); 3849 3849 3850 3850 if (memcmp(fs_info->fsid, sb->dev_item.fsid, BTRFS_UUID_SIZE) != 0) { 3851 3851 printk(KERN_ERR "BTRFS: dev_item UUID does not match fsid: %pU != %pU\n", ··· 3857 3857 * Hint to catch really bogus numbers, bitflips or so, more exact checks are 3858 3858 * done later 3859 3859 */ 3860 - if (sb->num_devices > (1UL << 31)) 3860 + if (btrfs_super_num_devices(sb) > (1UL << 31)) 3861 3861 printk(KERN_WARNING "BTRFS: suspicious number of devices: %llu\n", 3862 - sb->num_devices); 3862 + btrfs_super_num_devices(sb)); 3863 3863 3864 - if (sb->bytenr != BTRFS_SUPER_INFO_OFFSET) { 3864 + if (btrfs_super_bytenr(sb) != BTRFS_SUPER_INFO_OFFSET) { 3865 3865 printk(KERN_ERR "BTRFS: super offset mismatch %llu != %u\n", 3866 - sb->bytenr, BTRFS_SUPER_INFO_OFFSET); 3866 + btrfs_super_bytenr(sb), BTRFS_SUPER_INFO_OFFSET); 3867 3867 ret = -EINVAL; 3868 3868 } 3869 3869 ··· 3871 3871 * The generation is a global counter, we'll trust it more than the others 3872 3872 * but it's still possible that it's the one that's wrong. 3873 3873 */ 3874 - if (sb->generation < sb->chunk_root_generation) 3874 + if (btrfs_super_generation(sb) < btrfs_super_chunk_root_generation(sb)) 3875 3875 printk(KERN_WARNING 3876 3876 "BTRFS: suspicious: generation < chunk_root_generation: %llu < %llu\n", 3877 - sb->generation, sb->chunk_root_generation); 3878 - if (sb->generation < sb->cache_generation && sb->cache_generation != (u64)-1) 3877 + btrfs_super_generation(sb), btrfs_super_chunk_root_generation(sb)); 3878 + if (btrfs_super_generation(sb) < btrfs_super_cache_generation(sb) 3879 + && btrfs_super_cache_generation(sb) != (u64)-1) 3879 3880 printk(KERN_WARNING 3880 3881 "BTRFS: suspicious: generation < cache_generation: %llu < %llu\n", 3881 - sb->generation, sb->cache_generation); 3882 + btrfs_super_generation(sb), btrfs_super_cache_generation(sb)); 3882 3883 3883 3884 return ret; 3884 3885 }
+2 -16
fs/btrfs/extent-tree.c
··· 710 710 rcu_read_unlock(); 711 711 } 712 712 713 - /* simple helper to search for an existing extent at a given offset */ 714 - int btrfs_lookup_extent(struct btrfs_root *root, u64 start, u64 len) 713 + /* simple helper to search for an existing data extent at a given offset */ 714 + int btrfs_lookup_data_extent(struct btrfs_root *root, u64 start, u64 len) 715 715 { 716 716 int ret; 717 717 struct btrfs_key key; ··· 726 726 key.type = BTRFS_EXTENT_ITEM_KEY; 727 727 ret = btrfs_search_slot(NULL, root->fs_info->extent_root, &key, path, 728 728 0, 0); 729 - if (ret > 0) { 730 - btrfs_item_key_to_cpu(path->nodes[0], &key, path->slots[0]); 731 - if (key.objectid == start && 732 - key.type == BTRFS_METADATA_ITEM_KEY) 733 - ret = 0; 734 - } 735 729 btrfs_free_path(path); 736 730 return ret; 737 731 } ··· 780 786 else 781 787 key.type = BTRFS_EXTENT_ITEM_KEY; 782 788 783 - again: 784 789 ret = btrfs_search_slot(trans, root->fs_info->extent_root, 785 790 &key, path, 0, 0); 786 791 if (ret < 0) ··· 794 801 key.type == BTRFS_EXTENT_ITEM_KEY && 795 802 key.offset == root->nodesize) 796 803 ret = 0; 797 - } 798 - if (ret) { 799 - key.objectid = bytenr; 800 - key.type = BTRFS_EXTENT_ITEM_KEY; 801 - key.offset = root->nodesize; 802 - btrfs_release_path(path); 803 - goto again; 804 804 } 805 805 } 806 806
+1
fs/btrfs/super.c
··· 2151 2151 extent_map_exit(); 2152 2152 extent_io_exit(); 2153 2153 btrfs_interface_exit(); 2154 + btrfs_end_io_wq_exit(); 2154 2155 unregister_filesystem(&btrfs_fs_type); 2155 2156 btrfs_exit_sysfs(); 2156 2157 btrfs_cleanup_fs_uuids();
+1 -1
fs/btrfs/tree-log.c
··· 672 672 * is this extent already allocated in the extent 673 673 * allocation tree? If so, just add a reference 674 674 */ 675 - ret = btrfs_lookup_extent(root, ins.objectid, 675 + ret = btrfs_lookup_data_extent(root, ins.objectid, 676 676 ins.offset); 677 677 if (ret == 0) { 678 678 ret = btrfs_inc_extent_ref(trans, root,