summaryrefslogtreecommitdiffstats
path: root/sys/ufs
diff options
context:
space:
mode:
authormckusick <mckusick@FreeBSD.org>2003-10-17 13:57:58 +0000
committermckusick <mckusick@FreeBSD.org>2003-10-17 13:57:58 +0000
commitb19170c4bab94d6f8ad0bf113030128add54312e (patch)
treebaac0a25ed1f7579f2d0b526b080c959eb0bd5eb /sys/ufs
parent888092f3177624c3c2e4fefc32d70472e7640a0f (diff)
downloadFreeBSD-src-b19170c4bab94d6f8ad0bf113030128add54312e.zip
FreeBSD-src-b19170c4bab94d6f8ad0bf113030128add54312e.tar.gz
When expunging unlinked files from a snapshot, skip over holes in the
file rather than panicing with "indiracct: botched params". Submitted by: Mark Santcroos <marks@ripe.net>
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ffs/ffs_snapshot.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/sys/ufs/ffs/ffs_snapshot.c b/sys/ufs/ffs/ffs_snapshot.c
index 7d61329..b3b54d1 100644
--- a/sys/ufs/ffs/ffs_snapshot.c
+++ b/sys/ufs/ffs/ffs_snapshot.c
@@ -911,10 +911,15 @@ indiracct_ufs1(snapvp, cancelvp, level, blkno, lbn, rlbn, remblks,
ufs1_daddr_t last, *bap;
struct buf *bp;
+ if (blkno == 0) {
+ if (expungetype == BLK_NOCOPY)
+ return (0);
+ panic("indiracct_ufs1: missing indir");
+ }
if ((error = ufs_getlbns(cancelvp, rlbn, indirs, &num)) != 0)
return (error);
- if (lbn != indirs[num - 1 - level].in_lbn || blkno == 0 || num < 2)
- panic("indiracct: botched params");
+ if (lbn != indirs[num - 1 - level].in_lbn || num < 2)
+ panic("indiracct_ufs1: botched params");
/*
* We have to expand bread here since it will deadlock looking
* up the block number for any blocks that are not in the cache.
@@ -1020,7 +1025,7 @@ snapacct_ufs1(vp, oldblkp, lastblkp, fs, lblkno, expungetype)
brelse(ibp);
} else {
if (*blkp != 0)
- panic("snapacct: bad block");
+ panic("snapacct_ufs1: bad block");
*blkp = expungetype;
if (lbn >= NDADDR)
bdwrite(ibp);
@@ -1186,10 +1191,15 @@ indiracct_ufs2(snapvp, cancelvp, level, blkno, lbn, rlbn, remblks,
ufs2_daddr_t last, *bap;
struct buf *bp;
+ if (blkno == 0) {
+ if (expungetype == BLK_NOCOPY)
+ return (0);
+ panic("indiracct_ufs2: missing indir");
+ }
if ((error = ufs_getlbns(cancelvp, rlbn, indirs, &num)) != 0)
return (error);
- if (lbn != indirs[num - 1 - level].in_lbn || blkno == 0 || num < 2)
- panic("indiracct: botched params");
+ if (lbn != indirs[num - 1 - level].in_lbn || num < 2)
+ panic("indiracct_ufs2: botched params");
/*
* We have to expand bread here since it will deadlock looking
* up the block number for any blocks that are not in the cache.
@@ -1295,7 +1305,7 @@ snapacct_ufs2(vp, oldblkp, lastblkp, fs, lblkno, expungetype)
brelse(ibp);
} else {
if (*blkp != 0)
- panic("snapacct: bad block");
+ panic("snapacct_ufs2: bad block");
*blkp = expungetype;
if (lbn >= NDADDR)
bdwrite(ibp);
OpenPOWER on IntegriCloud