Fix a bug in fsck_ffs(8) triggered by corrupted filesystems.

Add missing check for failed block read when checking information about
a snapshot file.

Reported-by:  Andreas Bock
PR:           274404
MFC-after:    1 week
This commit is contained in:
Kirk McKusick 2023-10-20 15:14:46 -07:00
parent a113f9dd98
commit 1e39a0886e

View file

@ -299,6 +299,8 @@ checksnapinfo(struct inode *snapip)
size = fragroundup(fs,
DIP(snapip->i_dp, di_size) - lblktosize(fs, lbn));
bp = getdatablk(idesc.id_parent, size, BT_DATA);
if (bp->b_errs != 0)
return (0);
snapblklist = (daddr_t *)bp->b_un.b_buf;
/*
* snapblklist[0] is the size of the list