summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authortegge <tegge@FreeBSD.org>2006-05-15 22:52:22 +0000
committertegge <tegge@FreeBSD.org>2006-05-15 22:52:22 +0000
commite757e51d552221d5d5660b6939ee4190d1ab6d65 (patch)
treea082640ff86488ee9bc5098f8eb534e5d64ad3f4 /sys
parent988c4b7d3434cee9f6d0ed44f271493796980956 (diff)
downloadFreeBSD-src-e757e51d552221d5d5660b6939ee4190d1ab6d65.zip
FreeBSD-src-e757e51d552221d5d5660b6939ee4190d1ab6d65.tar.gz
Errors detected while file system is suspended should not trigger an
assertion failure.
Diffstat (limited to 'sys')
-rw-r--r--sys/ufs/ffs/ffs_snapshot.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/ufs/ffs/ffs_snapshot.c b/sys/ufs/ffs/ffs_snapshot.c
index c8dcdcd..2b5bf1c 100644
--- a/sys/ufs/ffs/ffs_snapshot.c
+++ b/sys/ufs/ffs/ffs_snapshot.c
@@ -215,10 +215,7 @@ ffs_snapshot(mp, snapfile)
ump = VFSTOUFS(mp);
fs = ump->um_fs;
- /*
- * XXX: make sure we don't go to out1 before we setup sn
- */
- sn = (void *)0xdeadbeef;
+ sn = NULL;
/*
* Need to serialize access to snapshot code per filesystem.
@@ -422,7 +419,6 @@ restart:
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
if (ip->i_effnlink == 0) {
error = ENOENT; /* Snapshot file unlinked */
- sn = NULL;
goto out1;
}
if (collectsnapstats)
@@ -673,7 +669,9 @@ loop:
ASSERT_VOP_LOCKED(vp, "ffs_snapshot vp");
vp->v_vflag |= VV_SYSTEM;
out1:
- KASSERT(sn != (void *)0xdeadbeef, ("email phk@ and mckusick@"));
+ KASSERT((sn != NULL && sbp != NULL && error == 0) ||
+ (sn == NULL && sbp == NULL && error != 0),
+ ("email phk@ and mckusick@"));
/*
* Resume operation on filesystem.
*/
OpenPOWER on IntegriCloud