summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/relocation.c
diff options
context:
space:
mode:
authorJosef Bacik <jbacik@fusionio.com>2013-07-30 15:44:09 -0400
committerChris Mason <chris.mason@fusionio.com>2013-09-01 08:04:40 -0400
commitd062d13cf1a100d5632306a28f9a9f54aced1280 (patch)
treefd3bd85c629c61ccdfbc87f5f31f488b887736f0 /fs/btrfs/relocation.c
parent151a41bc46df2a9cb5e05c3b3265cedc1f65a86f (diff)
downloadop-kernel-dev-d062d13cf1a100d5632306a28f9a9f54aced1280.zip
op-kernel-dev-d062d13cf1a100d5632306a28f9a9f54aced1280.tar.gz
Btrfs: check to see if we have an inline item properly
If our item isn't big enough to have an actual inline item when we have skinny metadata enabled just return 1 in find_inline_backref so we can move on to the next item. This probably wasn't causing a problem since we check the values of ptr and end properly, but just in case this will keep us from doing extra work. Thanks, Signed-off-by: Josef Bacik <jbacik@fusionio.com> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'fs/btrfs/relocation.c')
-rw-r--r--fs/btrfs/relocation.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
index 5a23d87..8168fb3 100644
--- a/fs/btrfs/relocation.c
+++ b/fs/btrfs/relocation.c
@@ -641,6 +641,11 @@ int find_inline_backref(struct extent_buffer *leaf, int slot,
WARN_ON(item_size < sizeof(*ei) + sizeof(*bi));
return 1;
}
+ if (key.type == BTRFS_METADATA_ITEM_KEY &&
+ item_size <= sizeof(*ei)) {
+ WARN_ON(item_size < sizeof(*ei));
+ return 1;
+ }
if (key.type == BTRFS_EXTENT_ITEM_KEY) {
bi = (struct btrfs_tree_block_info *)(ei + 1);
OpenPOWER on IntegriCloud