提交 8247b41a 编写于 作者: Y Yan Zheng 提交者: Chris Mason

Btrfs: Fix starting search offset inside btrfs_drop_extents

btrfs_drop_extents will drop paths and search again when it needs to
force COW of higher nodes.  It was using the key it found during the last
search as the offset for the next search.

But, this wasn't always correct.  The key could be from before our desired
range, and because we're dropping the path, it is possible for file's items
to change while we do the search again.

The fix here is to make sure we don't search for something smaller than
the offset btrfs_drop_extents was called with.
Signed-off-by: NChris Mason <chris.mason@oracle.com>
上级 8a1413a2
......@@ -436,7 +436,7 @@ int noinline btrfs_drop_extents(struct btrfs_trans_handle *trans,
goto out;
}
if (recow) {
search_start = key.offset;
search_start = max(key.offset, start);
continue;
}
if (btrfs_key_type(&key) == BTRFS_EXTENT_DATA_KEY) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册