aboutsummaryrefslogtreecommitdiff
path: root/sys/ufs
diff options
context:
space:
mode:
authorMike Pritchard <mpp@FreeBSD.org>1997-02-10 17:05:30 +0000
committerMike Pritchard <mpp@FreeBSD.org>1997-02-10 17:05:30 +0000
commit812ac98e839c37c77a678d7bb718cca9b174d662 (patch)
treefca86e748d6d828408e14f41b0e8f5f7fd84fbc5 /sys/ufs
parentb49b12158f27e4b5a920bfa10367669e4fb00aea (diff)
downloadsrc-812ac98e839c37c77a678d7bb718cca9b174d662.tar.gz
src-812ac98e839c37c77a678d7bb718cca9b174d662.zip
Correct the new Lite2 #ifdef DIAGNOSTIC ffs_checkblk routine
to not return without setting a return value when it can't read a block error or detects a bad cylinder group, since the caller is expecting a return value. It will now panic at this point, since the thing to do in this case would be to return a "bad block" status to the caller, and the caller will panic anyways when that happens. Also updated to panic strings in this routine to read "ffs_checkblk: ..." instead of "checkblk: ...".
Notes
Notes: svn path=/head/; revision=22544
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ffs/ffs_alloc.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c
index 4787c1c0df22..dec4f753d03a 100644
--- a/sys/ufs/ffs/ffs_alloc.c
+++ b/sys/ufs/ffs/ffs_alloc.c
@@ -1360,6 +1360,7 @@ ffs_blkfree(ip, bno, size)
* Verify allocation of a block or fragment. Returns true if block or
* fragment is allocated, false if it is free.
*/
+int
ffs_checkblk(ip, bno, size)
struct inode *ip;
ufs_daddr_t bno;
@@ -1374,21 +1375,17 @@ ffs_checkblk(ip, bno, size)
if ((u_int)size > fs->fs_bsize || fragoff(fs, size) != 0) {
printf("bsize = %d, size = %d, fs = %s\n",
fs->fs_bsize, size, fs->fs_fsmnt);
- panic("checkblk: bad size");
+ panic("ffs_checkblk: bad size");
}
if ((u_int)bno >= fs->fs_size)
- panic("checkblk: bad block %d", bno);
+ panic("ffs_checkblk: bad block %d", bno);
error = bread(ip->i_devvp, fsbtodb(fs, cgtod(fs, dtog(fs, bno))),
(int)fs->fs_cgsize, NOCRED, &bp);
- if (error) {
- brelse(bp);
- return;
- }
+ if (error)
+ panic("ffs_checkblk: cg bread failed");
cgp = (struct cg *)bp->b_data;
- if (!cg_chkmagic(cgp)) {
- brelse(bp);
- return;
- }
+ if (!cg_chkmagic(cgp))
+ panic("ffs_checkblk: cg magic mismatch");
bno = dtogd(fs, bno);
if (size == fs->fs_bsize) {
free = ffs_isblock(fs, cg_blksfree(cgp), fragstoblks(fs, bno));
@@ -1398,7 +1395,7 @@ ffs_checkblk(ip, bno, size)
if (isset(cg_blksfree(cgp), bno + i))
free++;
if (free != 0 && free != frags)
- panic("checkblk: partially free fragment");
+ panic("ffs_checkblk: partially free fragment");
}
brelse(bp);
return (!free);