diff options
| author | Kirk McKusick <mckusick@FreeBSD.org> | 2002-10-23 21:47:02 +0000 |
|---|---|---|
| committer | Kirk McKusick <mckusick@FreeBSD.org> | 2002-10-23 21:47:02 +0000 |
| commit | c0762674c91c1b0931711b962e51e04a8200a109 (patch) | |
| tree | 793292f1def35da471e64cb1bbfe6c585d3aab68 /sys | |
| parent | c3ff11578e38599abd75594d2571486cda6aa3ed (diff) | |
Notes
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/ufs/ffs/ffs_softdep.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index 8cbf3d8f87b08..422cabca74bea 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -685,6 +685,13 @@ process_worklist_item(matchmnt, flags) struct vnode *vp; int matchcnt = 0; + /* + * If we are being called because of a process doing a + * copy-on-write, then it is not safe to write as we may + * recurse into the copy-on-write routine. + */ + if (curthread->td_proc->p_flag & P_COWINPROGRESS) + return (-1); ACQUIRE_LOCK(&lk); /* * Normally we just process each item on the worklist in order. @@ -5427,7 +5434,13 @@ softdep_request_cleanup(fs, vp) needed = fs->fs_cstotal.cs_nbfree + fs->fs_contigsumsize; starttime = time_second + tickdelay; - if (UFS_UPDATE(vp, 1) != 0) + /* + * If we are being called because of a process doing a + * copy-on-write, then it is not safe to update the vnode + * as we may recurse into the copy-on-write routine. + */ + if ((curthread->td_proc->p_flag & P_COWINPROGRESS) == 0 && + UFS_UPDATE(vp, 1) != 0) return (0); while (fs->fs_pendingblocks > 0 && fs->fs_cstotal.cs_nbfree <= needed) { if (time_second > starttime) |
