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 'for-6.17-rc6-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux

Pull btrfs fixes from David Sterba:

- in zoned mode, turn assertion to proper code when reserving space in
relocation block group

- fix search key of extended ref (hardlink) when replaying log

- fix initialization of file extent tree on filesystems without
no-holes feature

- add harmless data race annotation to block group comparator

* tag 'for-6.17-rc6-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
btrfs: annotate block group access with data_race() when sorting for reclaim
btrfs: initialize inode::file_extent_tree after i_mode has been set
btrfs: zoned: fix incorrect ASSERT in btrfs_zoned_reserve_data_reloc_bg()
btrfs: fix invalid extref key setup when replaying dentry

+15 -12
+8 -1
fs/btrfs/block-group.c
··· 1795 1795 bg1 = list_entry(a, struct btrfs_block_group, bg_list); 1796 1796 bg2 = list_entry(b, struct btrfs_block_group, bg_list); 1797 1797 1798 - return bg1->used > bg2->used; 1798 + /* 1799 + * Some other task may be updating the ->used field concurrently, but it 1800 + * is not serious if we get a stale value or load/store tearing issues, 1801 + * as sorting the list of block groups to reclaim is not critical and an 1802 + * occasional imperfect order is ok. So silence KCSAN and avoid the 1803 + * overhead of locking or any other synchronization. 1804 + */ 1805 + return data_race(bg1->used > bg2->used); 1799 1806 } 1800 1807 1801 1808 static inline bool btrfs_should_reclaim(const struct btrfs_fs_info *fs_info)
-3
fs/btrfs/delayed-inode.c
··· 1843 1843 1844 1844 int btrfs_fill_inode(struct btrfs_inode *inode, u32 *rdev) 1845 1845 { 1846 - struct btrfs_fs_info *fs_info = inode->root->fs_info; 1847 1846 struct btrfs_delayed_node *delayed_node; 1848 1847 struct btrfs_inode_item *inode_item; 1849 1848 struct inode *vfs_inode = &inode->vfs_inode; ··· 1863 1864 i_uid_write(vfs_inode, btrfs_stack_inode_uid(inode_item)); 1864 1865 i_gid_write(vfs_inode, btrfs_stack_inode_gid(inode_item)); 1865 1866 btrfs_i_size_write(inode, btrfs_stack_inode_size(inode_item)); 1866 - btrfs_inode_set_file_extent_range(inode, 0, 1867 - round_up(i_size_read(vfs_inode), fs_info->sectorsize)); 1868 1867 vfs_inode->i_mode = btrfs_stack_inode_mode(inode_item); 1869 1868 set_nlink(vfs_inode, btrfs_stack_inode_nlink(inode_item)); 1870 1869 inode_set_bytes(vfs_inode, btrfs_stack_inode_nbytes(inode_item));
+5 -6
fs/btrfs/inode.c
··· 3885 3885 bool filled = false; 3886 3886 int first_xattr_slot; 3887 3887 3888 - ret = btrfs_init_file_extent_tree(inode); 3889 - if (ret) 3890 - goto out; 3891 - 3892 3888 ret = btrfs_fill_inode(inode, &rdev); 3893 3889 if (!ret) 3894 3890 filled = true; ··· 3916 3920 i_uid_write(vfs_inode, btrfs_inode_uid(leaf, inode_item)); 3917 3921 i_gid_write(vfs_inode, btrfs_inode_gid(leaf, inode_item)); 3918 3922 btrfs_i_size_write(inode, btrfs_inode_size(leaf, inode_item)); 3919 - btrfs_inode_set_file_extent_range(inode, 0, 3920 - round_up(i_size_read(vfs_inode), fs_info->sectorsize)); 3921 3923 3922 3924 inode_set_atime(vfs_inode, btrfs_timespec_sec(leaf, &inode_item->atime), 3923 3925 btrfs_timespec_nsec(leaf, &inode_item->atime)); ··· 3947 3953 btrfs_set_inode_mapping_order(inode); 3948 3954 3949 3955 cache_index: 3956 + ret = btrfs_init_file_extent_tree(inode); 3957 + if (ret) 3958 + goto out; 3959 + btrfs_inode_set_file_extent_range(inode, 0, 3960 + round_up(i_size_read(vfs_inode), fs_info->sectorsize)); 3950 3961 /* 3951 3962 * If we were modified in the current generation and evicted from memory 3952 3963 * and then re-read we need to do a full sync since we don't have any
+1 -1
fs/btrfs/tree-log.c
··· 1964 1964 1965 1965 search_key.objectid = log_key.objectid; 1966 1966 search_key.type = BTRFS_INODE_EXTREF_KEY; 1967 - search_key.offset = key->objectid; 1967 + search_key.offset = btrfs_extref_hash(key->objectid, name.name, name.len); 1968 1968 ret = backref_in_log(root->log_root, &search_key, key->objectid, &name); 1969 1969 if (ret < 0) { 1970 1970 goto out;
+1 -1
fs/btrfs/zoned.c
··· 2582 2582 spin_lock(&space_info->lock); 2583 2583 space_info->total_bytes -= bg->length; 2584 2584 space_info->disk_total -= bg->length * factor; 2585 + space_info->disk_total -= bg->zone_unusable; 2585 2586 /* There is no allocation ever happened. */ 2586 2587 ASSERT(bg->used == 0); 2587 - ASSERT(bg->zone_unusable == 0); 2588 2588 /* No super block in a block group on the zoned setup. */ 2589 2589 ASSERT(bg->bytes_super == 0); 2590 2590 spin_unlock(&space_info->lock);