diff options
author | Josef Bacik <josef@redhat.com> | 2011-01-28 19:44:44 +0100 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2011-01-28 22:42:34 +0100 |
commit | ad0397a7a97f55fd7f70998ec208c5d8b90310ff (patch) | |
tree | dbebfe94a571155d4f376e265026c9a1ca1e2f2f | |
parent | Btrfs: use the global block reserve if we cannot reserve space (diff) | |
download | linux-ad0397a7a97f55fd7f70998ec208c5d8b90310ff.tar.xz linux-ad0397a7a97f55fd7f70998ec208c5d8b90310ff.zip |
Btrfs: do error checking in btrfs_del_csums
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>
-rw-r--r-- | fs/btrfs/file-item.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/btrfs/file-item.c b/fs/btrfs/file-item.c index d0bc72657cd7..4f19a3e1bf32 100644 --- a/fs/btrfs/file-item.c +++ b/fs/btrfs/file-item.c @@ -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]); |