Skip to content

Commit

Permalink
Btrfs: do error checking in btrfs_del_csums
Browse files Browse the repository at this point in the history
Got a report of a box panicing because we got a NULL eb in read_extent_buffer.
His fs was borked and btrfs_search_path returned EIO, but we don't check for
errors so the box paniced.  Yes I know this will just make something higher up
the stack panic, but that's a problem for future Josef.  Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
  • Loading branch information
Josef Bacik authored and Chris Mason committed Jan 28, 2011
1 parent 68a8227 commit ad0397a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fs/btrfs/file-item.c
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,10 @@ int btrfs_del_csums(struct btrfs_trans_handle *trans,
if (path->slots[0] == 0)
goto out;
path->slots[0]--;
} else if (ret < 0) {
goto out;
}

leaf = path->nodes[0];
btrfs_item_key_to_cpu(leaf, &key, path->slots[0]);

Expand Down

0 comments on commit ad0397a

Please sign in to comment.