aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorFilipe Manana <fdmanana@suse.com>2024-04-29 13:08:12 +0100
committerDavid Sterba <dsterba@suse.com>2024-07-11 15:33:17 +0200
commit061ea8581b2e0ade913c8f5cd845e801976a577b (patch)
tree247ad71b877a75816791cc02cb1be61cf23a974b /tools/perf/scripts/python
parentbtrfs: use an xarray to track open inodes in a root (diff)
downloadlinux-061ea8581b2e0ade913c8f5cd845e801976a577b.tar.gz
linux-061ea8581b2e0ade913c8f5cd845e801976a577b.zip
btrfs: preallocate inodes xarray entry to avoid transaction abort
When creating a new inode, at btrfs_create_new_inode(), one of the very last steps is to add the inode to the root's inodes xarray. This often requires allocating memory which may fail (even though xarrays have a dedicated kmem_cache which make it less likely to fail), and at that point we are forced to abort the current transaction (as some, but not all, of the inode metadata was added to its subvolume btree). To avoid a transaction abort, preallocate memory for the xarray early at btrfs_create_new_inode(), so that if we fail we don't need to abort the transaction and the insertion into the xarray is guaranteed to succeed. Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions