Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Josef Bacik and committed by
Chris Mason
ad0397a7 68a82277

+3
+3
fs/btrfs/file-item.c
··· 550 550 if (path->slots[0] == 0) 551 551 goto out; 552 552 path->slots[0]--; 553 + } else if (ret < 0) { 554 + goto out; 553 555 } 556 + 554 557 leaf = path->nodes[0]; 555 558 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]); 556 559