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

Pull btrfs fixes from David Sterba:

- with large folios in use, fix partial incorrect update of a reflinked
range

- fix potential deadlock in iget when lookup fails and eviction is
needed

- in send, validate inline extent type while detecting file holes

- fix memory leak after an error when creating a space info

- remove zone statistics from sysfs again, the output size limitations
make it unusable, we'll do it in another way in another release

- test fixes:
- return proper error codes from block remapping tests
- fix tree root leaks in qgroup tests after errors

* tag 'for-6.19-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
btrfs: remove zoned statistics from sysfs
btrfs: fix memory leaks in create_space_info() error paths
btrfs: invalidate pages instead of truncate after reflinking
btrfs: update the Kconfig string for CONFIG_BTRFS_EXPERIMENTAL
btrfs: send: check for inline extents in range_is_hole_in_parent()
btrfs: tests: fix return 0 on rmap test failure
btrfs: tests: fix root tree leak in btrfs_test_qgroups()
btrfs: release path before iget_failed() in btrfs_read_locked_inode()

+41 -68
+5 -1
fs/btrfs/Kconfig
··· 115 115 116 116 - extent tree v2 - complex rework of extent tracking 117 117 118 - - large folio support 118 + - large folio and block size (> page size) support 119 + 120 + - shutdown ioctl and auto-degradation support 121 + 122 + - asynchronous checksum generation for data writes 119 123 120 124 If unsure, say N.
+9
fs/btrfs/inode.c
··· 4180 4180 4181 4181 return 0; 4182 4182 out: 4183 + /* 4184 + * We may have a read locked leaf and iget_failed() triggers inode 4185 + * eviction which needs to release the delayed inode and that needs 4186 + * to lock the delayed inode's mutex. This can cause a ABBA deadlock 4187 + * with a task running delayed items, as that require first locking 4188 + * the delayed inode's mutex and then modifying its subvolume btree. 4189 + * So release the path before iget_failed(). 4190 + */ 4191 + btrfs_release_path(path); 4183 4192 iget_failed(vfs_inode); 4184 4193 return ret; 4185 4194 }
+13 -10
fs/btrfs/reflink.c
··· 705 705 struct inode *src = file_inode(file_src); 706 706 struct btrfs_fs_info *fs_info = inode_to_fs_info(inode); 707 707 int ret; 708 - int wb_ret; 709 708 u64 len = olen; 710 709 u64 bs = fs_info->sectorsize; 711 710 u64 end; ··· 749 750 btrfs_lock_extent(&BTRFS_I(inode)->io_tree, destoff, end, &cached_state); 750 751 ret = btrfs_clone(src, inode, off, olen, len, destoff, 0); 751 752 btrfs_unlock_extent(&BTRFS_I(inode)->io_tree, destoff, end, &cached_state); 753 + if (ret < 0) 754 + return ret; 752 755 753 756 /* 754 757 * We may have copied an inline extent into a page of the destination 755 - * range, so wait for writeback to complete before truncating pages 758 + * range, so wait for writeback to complete before invalidating pages 756 759 * from the page cache. This is a rare case. 757 760 */ 758 - wb_ret = btrfs_wait_ordered_range(BTRFS_I(inode), destoff, len); 759 - ret = ret ? ret : wb_ret; 761 + ret = btrfs_wait_ordered_range(BTRFS_I(inode), destoff, len); 762 + if (ret < 0) 763 + return ret; 764 + 760 765 /* 761 - * Truncate page cache pages so that future reads will see the cloned 762 - * data immediately and not the previous data. 766 + * Invalidate page cache so that future reads will see the cloned data 767 + * immediately and not the previous data. 763 768 */ 764 - truncate_inode_pages_range(&inode->i_data, 765 - round_down(destoff, PAGE_SIZE), 766 - round_up(destoff + len, PAGE_SIZE) - 1); 769 + ret = filemap_invalidate_inode(inode, false, destoff, end); 770 + if (ret < 0) 771 + return ret; 767 772 768 773 btrfs_btree_balance_dirty(fs_info); 769 774 770 - return ret; 775 + return 0; 771 776 } 772 777 773 778 static int btrfs_remap_file_range_prep(struct file *file_in, loff_t pos_in,
+2
fs/btrfs/send.c
··· 6383 6383 extent_end = btrfs_file_extent_end(path); 6384 6384 if (extent_end <= start) 6385 6385 goto next; 6386 + if (btrfs_file_extent_type(leaf, fi) == BTRFS_FILE_EXTENT_INLINE) 6387 + return 0; 6386 6388 if (btrfs_file_extent_disk_bytenr(leaf, fi) == 0) { 6387 6389 search_start = extent_end; 6388 6390 goto next;
+6 -2
fs/btrfs/space-info.c
··· 306 306 0); 307 307 308 308 if (ret) 309 - return ret; 309 + goto out_free; 310 310 } 311 311 312 312 ret = btrfs_sysfs_add_space_info_type(space_info); 313 313 if (ret) 314 - return ret; 314 + goto out_free; 315 315 316 316 list_add(&space_info->list, &info->space_info); 317 317 if (flags & BTRFS_BLOCK_GROUP_DATA) 318 318 info->data_sinfo = space_info; 319 319 320 + return ret; 321 + 322 + out_free: 323 + kfree(space_info); 320 324 return ret; 321 325 } 322 326
-52
fs/btrfs/sysfs.c
··· 26 26 #include "misc.h" 27 27 #include "fs.h" 28 28 #include "accessors.h" 29 - #include "zoned.h" 30 29 31 30 /* 32 31 * Structure name Path ··· 1188 1189 } 1189 1190 BTRFS_ATTR_RW(, commit_stats, btrfs_commit_stats_show, btrfs_commit_stats_store); 1190 1191 1191 - static ssize_t btrfs_zoned_stats_show(struct kobject *kobj, 1192 - struct kobj_attribute *a, char *buf) 1193 - { 1194 - struct btrfs_fs_info *fs_info = to_fs_info(kobj); 1195 - struct btrfs_block_group *bg; 1196 - size_t ret = 0; 1197 - 1198 - 1199 - if (!btrfs_is_zoned(fs_info)) 1200 - return ret; 1201 - 1202 - spin_lock(&fs_info->zone_active_bgs_lock); 1203 - ret += sysfs_emit_at(buf, ret, "active block-groups: %zu\n", 1204 - list_count_nodes(&fs_info->zone_active_bgs)); 1205 - spin_unlock(&fs_info->zone_active_bgs_lock); 1206 - 1207 - mutex_lock(&fs_info->reclaim_bgs_lock); 1208 - spin_lock(&fs_info->unused_bgs_lock); 1209 - ret += sysfs_emit_at(buf, ret, "\treclaimable: %zu\n", 1210 - list_count_nodes(&fs_info->reclaim_bgs)); 1211 - ret += sysfs_emit_at(buf, ret, "\tunused: %zu\n", 1212 - list_count_nodes(&fs_info->unused_bgs)); 1213 - spin_unlock(&fs_info->unused_bgs_lock); 1214 - mutex_unlock(&fs_info->reclaim_bgs_lock); 1215 - 1216 - ret += sysfs_emit_at(buf, ret, "\tneed reclaim: %s\n", 1217 - str_true_false(btrfs_zoned_should_reclaim(fs_info))); 1218 - 1219 - if (fs_info->data_reloc_bg) 1220 - ret += sysfs_emit_at(buf, ret, 1221 - "data relocation block-group: %llu\n", 1222 - fs_info->data_reloc_bg); 1223 - if (fs_info->treelog_bg) 1224 - ret += sysfs_emit_at(buf, ret, 1225 - "tree-log block-group: %llu\n", 1226 - fs_info->treelog_bg); 1227 - 1228 - spin_lock(&fs_info->zone_active_bgs_lock); 1229 - ret += sysfs_emit_at(buf, ret, "active zones:\n"); 1230 - list_for_each_entry(bg, &fs_info->zone_active_bgs, active_bg_list) { 1231 - ret += sysfs_emit_at(buf, ret, 1232 - "\tstart: %llu, wp: %llu used: %llu, reserved: %llu, unusable: %llu\n", 1233 - bg->start, bg->alloc_offset, bg->used, 1234 - bg->reserved, bg->zone_unusable); 1235 - } 1236 - spin_unlock(&fs_info->zone_active_bgs_lock); 1237 - return ret; 1238 - } 1239 - BTRFS_ATTR(, zoned_stats, btrfs_zoned_stats_show); 1240 - 1241 1192 static ssize_t btrfs_clone_alignment_show(struct kobject *kobj, 1242 1193 struct kobj_attribute *a, char *buf) 1243 1194 { ··· 1600 1651 BTRFS_ATTR_PTR(, bg_reclaim_threshold), 1601 1652 BTRFS_ATTR_PTR(, commit_stats), 1602 1653 BTRFS_ATTR_PTR(, temp_fsid), 1603 - BTRFS_ATTR_PTR(, zoned_stats), 1604 1654 #ifdef CONFIG_BTRFS_EXPERIMENTAL 1605 1655 BTRFS_ATTR_PTR(, offload_csum), 1606 1656 #endif
+3
fs/btrfs/tests/extent-map-tests.c
··· 1059 1059 1060 1060 if (out_stripe_len != BTRFS_STRIPE_LEN) { 1061 1061 test_err("calculated stripe length doesn't match"); 1062 + ret = -EINVAL; 1062 1063 goto out; 1063 1064 } 1064 1065 ··· 1067 1066 for (i = 0; i < out_ndaddrs; i++) 1068 1067 test_msg("mapped %llu", logical[i]); 1069 1068 test_err("unexpected number of mapped addresses: %d", out_ndaddrs); 1069 + ret = -EINVAL; 1070 1070 goto out; 1071 1071 } 1072 1072 1073 1073 for (i = 0; i < out_ndaddrs; i++) { 1074 1074 if (logical[i] != test->mapped_logical[i]) { 1075 1075 test_err("unexpected logical address mapped"); 1076 + ret = -EINVAL; 1076 1077 goto out; 1077 1078 } 1078 1079 }
+3 -3
fs/btrfs/tests/qgroup-tests.c
··· 517 517 tmp_root->root_key.objectid = BTRFS_FS_TREE_OBJECTID; 518 518 root->fs_info->fs_root = tmp_root; 519 519 ret = btrfs_insert_fs_root(root->fs_info, tmp_root); 520 + btrfs_put_root(tmp_root); 520 521 if (ret) { 521 522 test_err("couldn't insert fs root %d", ret); 522 523 goto out; 523 524 } 524 - btrfs_put_root(tmp_root); 525 525 526 526 tmp_root = btrfs_alloc_dummy_root(fs_info); 527 527 if (IS_ERR(tmp_root)) { ··· 532 532 533 533 tmp_root->root_key.objectid = BTRFS_FIRST_FREE_OBJECTID; 534 534 ret = btrfs_insert_fs_root(root->fs_info, tmp_root); 535 + btrfs_put_root(tmp_root); 535 536 if (ret) { 536 - test_err("couldn't insert fs root %d", ret); 537 + test_err("couldn't insert subvolume root %d", ret); 537 538 goto out; 538 539 } 539 - btrfs_put_root(tmp_root); 540 540 541 541 test_msg("running qgroup tests"); 542 542 ret = test_no_shared_qgroup(root, sectorsize, nodesize);