Skip to content
Commit 6643558d authored by Yan Zheng's avatar Yan Zheng Committed by Chris Mason
Browse files

Btrfs: Fix bookend extent race v2



When dropping middle part of an extent, btrfs_drop_extents truncates
the extent at first, then inserts a bookend extent.

Since truncation and insertion can't be done atomically, there is a small
period that the bookend extent isn't in the tree. This causes problem for
functions that search the tree for file extent item. The way to fix this is
lock the range of the bookend extent before truncation.

Signed-off-by: default avatarYan Zheng <zheng.yan@oracle.com>
parent 9036c102
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment