aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/tree-mod-log.c
diff options
context:
space:
mode:
authorChristoph Hellwig <[email protected]>2023-05-24 15:03:14 +0000
committerDavid Sterba <[email protected]>2023-06-19 11:59:33 +0000
commit816f589b8d43f7c258b0c10a5ce29daf01614651 (patch)
tree6a7df70ef3ac6ba6f907b705d51d3104487056dc /fs/btrfs/tree-mod-log.c
parentbtrfs: split btrfs_alloc_ordered_extent to allocation and insertion helpers (diff)
downloadkernel-816f589b8d43f7c258b0c10a5ce29daf01614651.tar.gz
kernel-816f589b8d43f7c258b0c10a5ce29daf01614651.zip
btrfs: atomically insert the new extent in btrfs_split_ordered_extent
Currently there is a small race window in btrfs_split_ordered_extent, where the reduced old extent can be looked up on the per-inode rbtree or the per-root list while the newly split out one isn't visible yet. Fix this by open coding btrfs_alloc_ordered_extent in btrfs_split_ordered_extent, and holding the tree lock and root->ordered_extent_lock over the entire tree and extent manipulation. Note that this introduces new lock ordering because previously ordered_extent_lock was never held over the tree lock. Reviewed-by: Johannes Thumshirn <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
Diffstat (limited to 'fs/btrfs/tree-mod-log.c')
0 files changed, 0 insertions, 0 deletions