提交 7261009c 编写于 作者: Y Yan 提交者: Chris Mason

btrfs_drop_extents: handle BTRFS_INODE_REF_KEY types

It's possible "key.type == BTRFS_INODE_REF_KEY" and "key.offset >= end".
Signed-off-by: NChris Mason <chris.mason@oracle.com>
上级 068fe39f
......@@ -507,11 +507,12 @@ int btrfs_drop_extents(struct btrfs_trans_handle *trans,
slot = path->slots[0];
ret = 0;
btrfs_item_key_to_cpu(leaf, &key, slot);
if (key.offset >= end || key.objectid != inode->i_ino) {
if (btrfs_key_type(&key) == BTRFS_EXTENT_DATA_KEY &&
key.offset >= end) {
goto out;
}
if (btrfs_key_type(&key) > BTRFS_EXTENT_DATA_KEY) {
if (btrfs_key_type(&key) > BTRFS_EXTENT_DATA_KEY ||
key.objectid != inode->i_ino) {
goto out;
}
if (recow) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册