summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorkan <kan@FreeBSD.org>2004-03-16 22:06:32 +0000
committerkan <kan@FreeBSD.org>2004-03-16 22:06:32 +0000
commit7decbcc07ec8e5268d5527d9786b1aa24bc75e30 (patch)
tree14c34425679168647e5bef6f4412f2629feb0432 /sys
parent3cb81148d8a83b1e6c1a65937f9e6310ba617894 (diff)
downloadFreeBSD-src-7decbcc07ec8e5268d5527d9786b1aa24bc75e30.zip
FreeBSD-src-7decbcc07ec8e5268d5527d9786b1aa24bc75e30.tar.gz
Avoid doing bawrite to initialize inode block while holding cylinder
group block locked. If filesystem has any active snapshots, bawrite can come back trying to allocate new snapshot data block from the same cylinder group and cause panic due to recursive lock attempt. PR: 64206 Reviewed by: mckusick Tested by: pjd
Diffstat (limited to 'sys')
-rw-r--r--sys/ufs/ffs/ffs_alloc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c
index 15b81dc..6d4e592 100644
--- a/sys/ufs/ffs/ffs_alloc.c
+++ b/sys/ufs/ffs/ffs_alloc.c
@@ -1622,6 +1622,7 @@ gotit:
/*
* Check to see if we need to initialize more inodes.
*/
+ ibp = NULL;
if (fs->fs_magic == FS_UFS2_MAGIC &&
ipref + INOPB(fs) > cgp->cg_initediblk &&
cgp->cg_initediblk < cgp->cg_niblk) {
@@ -1634,12 +1635,13 @@ gotit:
dp2->di_gen = arc4random() / 2 + 1;
dp2++;
}
- bawrite(ibp);
cgp->cg_initediblk += INOPB(fs);
}
if (fs->fs_active != 0)
atomic_clear_int(&ACTIVECGNUM(fs, cg), ACTIVECGOFF(cg));
bdwrite(bp);
+ if (ibp != NULL)
+ bawrite(ibp);
return (cg * fs->fs_ipg + ipref);
}
OpenPOWER on IntegriCloud