summaryrefslogtreecommitdiff
path: root/sys/ufs
diff options
context:
space:
mode:
authorPedro Martelletto <pedro@cvs.openbsd.org>2007-04-15 10:48:36 +0000
committerPedro Martelletto <pedro@cvs.openbsd.org>2007-04-15 10:48:36 +0000
commit072d115376f451494f5371446fa52d77a4f6585b (patch)
tree1d09bef52d0386930bd7c978a014fd1ffd801982 /sys/ufs
parentb4086574d1b808d117ade8c54153e79be2816731 (diff)
Save block pointers contents before releasing interrupts so that panic
messages are consistent, from mickey@, okay pedro@
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ffs/ffs_softdep.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c
index 65c10c59fca..46fb3e75982 100644
--- a/sys/ufs/ffs/ffs_softdep.c
+++ b/sys/ufs/ffs/ffs_softdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ffs_softdep.c,v 1.85 2007/04/04 18:53:20 pedro Exp $ */
+/* $OpenBSD: ffs_softdep.c,v 1.86 2007/04/15 10:48:35 pedro Exp $ */
/*
* Copyright 1998, 2000 Marshall Kirk McKusick. All Rights Reserved.
@@ -3444,6 +3444,7 @@ initiate_write_inodeblock_ufs1(inodedep, bp)
struct fs *fs;
#ifdef DIAGNOSTIC
ufs_lbn_t prevlbn = 0;
+ ufs1_daddr_t d1, d2;
#endif
int i, deplist;
@@ -3490,18 +3491,18 @@ initiate_write_inodeblock_ufs1(inodedep, bp)
}
prevlbn = adp->ad_lbn;
if (adp->ad_lbn < NDADDR &&
- dp->di_db[adp->ad_lbn] != adp->ad_newblkno) {
+ (d1 = dp->di_db[adp->ad_lbn]) != (d2 = adp->ad_newblkno)) {
FREE_LOCK(&lk);
panic("%s: direct pointer #%ld mismatch %d != %d",
- "softdep_write_inodeblock", adp->ad_lbn,
- dp->di_db[adp->ad_lbn], adp->ad_newblkno);
+ "softdep_write_inodeblock", adp->ad_lbn, d1, d2);
}
if (adp->ad_lbn >= NDADDR &&
- dp->di_ib[adp->ad_lbn - NDADDR] != adp->ad_newblkno) {
+ (d1 = dp->di_ib[adp->ad_lbn - NDADDR]) !=
+ (d2 = adp->ad_newblkno)) {
FREE_LOCK(&lk);
panic("%s: indirect pointer #%ld mismatch %d != %d",
"softdep_write_inodeblock", adp->ad_lbn - NDADDR,
- dp->di_ib[adp->ad_lbn - NDADDR], adp->ad_newblkno);
+ d1, d2);
}
deplist |= 1 << adp->ad_lbn;
if ((adp->ad_state & ATTACHED) == 0) {
@@ -3590,7 +3591,7 @@ initiate_write_inodeblock_ufs2(inodedep, bp)
struct ufs2_dinode *dp;
struct fs *fs = inodedep->id_fs;
#ifdef DIAGNOSTIC
- ufs2_daddr_t prevlbn = -1;
+ ufs2_daddr_t prevlbn = -1, d1, d2;
#endif
int deplist, i;
@@ -3636,11 +3637,11 @@ initiate_write_inodeblock_ufs2(inodedep, bp)
panic("softdep_write_inodeblock: lbn order");
}
prevlbn = adp->ad_lbn;
- if (dp->di_extb[adp->ad_lbn] != adp->ad_newblkno) {
+ if ((d1 = dp->di_extb[adp->ad_lbn]) !=
+ (d2 = adp->ad_newblkno)) {
FREE_LOCK(&lk);
panic("%s: direct pointer #%ld mismatch %ld != %ld",
- "softdep_write_inodeblock", adp->ad_lbn,
- dp->di_extb[adp->ad_lbn], adp->ad_newblkno);
+ "softdep_write_inodeblock", adp->ad_lbn, d1, d2);
}
deplist |= 1 << adp->ad_lbn;
if ((adp->ad_state & ATTACHED) == 0) {
@@ -3704,18 +3705,18 @@ initiate_write_inodeblock_ufs2(inodedep, bp)
}
prevlbn = adp->ad_lbn;
if (adp->ad_lbn < NDADDR &&
- dp->di_db[adp->ad_lbn] != adp->ad_newblkno) {
+ (d1 = dp->di_db[adp->ad_lbn]) != (d2 = adp->ad_newblkno)) {
FREE_LOCK(&lk);
panic("%s: direct pointer #%ld mismatch %ld != %ld",
- "softdep_write_inodeblock", adp->ad_lbn,
- dp->di_db[adp->ad_lbn], adp->ad_newblkno);
+ "softdep_write_inodeblock", adp->ad_lbn, d1, d2);
}
if (adp->ad_lbn >= NDADDR &&
- dp->di_ib[adp->ad_lbn - NDADDR] != adp->ad_newblkno) {
+ (d1 = dp->di_ib[adp->ad_lbn - NDADDR]) !=
+ (d2 = adp->ad_newblkno)) {
FREE_LOCK(&lk);
panic("%s: indirect pointer #%ld mismatch %ld != %ld",
"softdep_write_inodeblock", adp->ad_lbn - NDADDR,
- dp->di_ib[adp->ad_lbn - NDADDR], adp->ad_newblkno);
+ d1, d2);
}
deplist |= 1 << adp->ad_lbn;
if ((adp->ad_state & ATTACHED) == 0) {