Skip to content

Commit fbbb0e0

Browse files
fdmananagregkh
authored andcommitted
btrfs: do regular iput instead of delayed iput during extent map shrinking
[ Upstream commit 15b3b32 ] The extent map shrinker now runs in the system unbound workqueue and no longer in kswapd context so it can directly do an iput() on inodes even if that blocks or needs to acquire any lock (we aren't holding any locks when requesting the delayed iput from the shrinker). So we don't need to add a delayed iput, wake up the cleaner and delegate the iput() to the cleaner, which also adds extra contention on the spinlock that protects the delayed iputs list. Reported-by: Ivan Shapovalov <intelfx@intelfx.name> Tested-by: Ivan Shapovalov <intelfx@intelfx.name> Link: https://lore.kernel.org/linux-btrfs/0414d690ac5680d0d77dfc930606cdc36e42e12f.camel@intelfx.name/ CC: stable@vger.kernel.org # 6.12+ Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: Filipe Manana <fdmanana@suse.com> Signed-off-by: David Sterba <dsterba@suse.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent fef55c4 commit fbbb0e0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/btrfs/extent_map.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1261,7 +1261,7 @@ static long btrfs_scan_root(struct btrfs_root *root, struct btrfs_em_shrink_ctx
12611261

12621262
min_ino = btrfs_ino(inode) + 1;
12631263
ctx->last_ino = btrfs_ino(inode);
1264-
btrfs_add_delayed_iput(inode);
1264+
iput(&inode->vfs_inode);
12651265

12661266
if (ctx->scanned >= ctx->nr_to_scan ||
12671267
btrfs_fs_closing(inode->root->fs_info))

0 commit comments

Comments
 (0)