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

Pull btrfs fixes from David Sterba:

- fix potential endless loop when discarding a block group when
disabling discard

- reinstate message when setting a large value of mount option 'commit'

- fix a folio leak when async extent submission fails

* tag 'for-6.15-rc6-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
btrfs: add back warning for mount option commit values exceeding 300
btrfs: fix folio leak in submit_one_async_extent()
btrfs: fix discard worker infinite loop after disabling discard

+27 -2
+15 -2
fs/btrfs/discard.c
··· 94 94 struct btrfs_block_group *block_group) 95 95 { 96 96 lockdep_assert_held(&discard_ctl->lock); 97 - if (!btrfs_run_discard_work(discard_ctl)) 98 - return; 99 97 100 98 if (list_empty(&block_group->discard_list) || 101 99 block_group->discard_index == BTRFS_DISCARD_INDEX_UNUSED) { ··· 114 116 struct btrfs_block_group *block_group) 115 117 { 116 118 if (!btrfs_is_block_group_data_only(block_group)) 119 + return; 120 + 121 + if (!btrfs_run_discard_work(discard_ctl)) 117 122 return; 118 123 119 124 spin_lock(&discard_ctl->lock); ··· 245 244 block_group->used != 0) { 246 245 if (btrfs_is_block_group_data_only(block_group)) { 247 246 __add_to_discard_list(discard_ctl, block_group); 247 + /* 248 + * The block group must have been moved to other 249 + * discard list even if discard was disabled in 250 + * the meantime or a transaction abort happened, 251 + * otherwise we can end up in an infinite loop, 252 + * always jumping into the 'again' label and 253 + * keep getting this block group over and over 254 + * in case there are no other block groups in 255 + * the discard lists. 256 + */ 257 + ASSERT(block_group->discard_index != 258 + BTRFS_DISCARD_INDEX_UNUSED); 248 259 } else { 249 260 list_del_init(&block_group->discard_list); 250 261 btrfs_put_block_group(block_group);
+1
fs/btrfs/fs.h
··· 300 300 #define BTRFS_FEATURE_INCOMPAT_SAFE_CLEAR 0ULL 301 301 302 302 #define BTRFS_DEFAULT_COMMIT_INTERVAL (30) 303 + #define BTRFS_WARNING_COMMIT_INTERVAL (300) 303 304 #define BTRFS_DEFAULT_MAX_INLINE (2048) 304 305 305 306 struct btrfs_dev_replace {
+7
fs/btrfs/inode.c
··· 1109 1109 struct extent_state *cached = NULL; 1110 1110 struct extent_map *em; 1111 1111 int ret = 0; 1112 + bool free_pages = false; 1112 1113 u64 start = async_extent->start; 1113 1114 u64 end = async_extent->start + async_extent->ram_size - 1; 1114 1115 ··· 1130 1129 } 1131 1130 1132 1131 if (async_extent->compress_type == BTRFS_COMPRESS_NONE) { 1132 + ASSERT(!async_extent->folios); 1133 + ASSERT(async_extent->nr_folios == 0); 1133 1134 submit_uncompressed_range(inode, async_extent, locked_folio); 1135 + free_pages = true; 1134 1136 goto done; 1135 1137 } 1136 1138 ··· 1149 1145 * fall back to uncompressed. 1150 1146 */ 1151 1147 submit_uncompressed_range(inode, async_extent, locked_folio); 1148 + free_pages = true; 1152 1149 goto done; 1153 1150 } 1154 1151 ··· 1191 1186 done: 1192 1187 if (async_chunk->blkcg_css) 1193 1188 kthread_associate_blkcg(NULL); 1189 + if (free_pages) 1190 + free_async_extent_pages(async_extent); 1194 1191 kfree(async_extent); 1195 1192 return; 1196 1193
+4
fs/btrfs/super.c
··· 569 569 break; 570 570 case Opt_commit_interval: 571 571 ctx->commit_interval = result.uint_32; 572 + if (ctx->commit_interval > BTRFS_WARNING_COMMIT_INTERVAL) { 573 + btrfs_warn(NULL, "excessive commit interval %u, use with care", 574 + ctx->commit_interval); 575 + } 572 576 if (ctx->commit_interval == 0) 573 577 ctx->commit_interval = BTRFS_DEFAULT_COMMIT_INTERVAL; 574 578 break;