diff options
author | tegge <tegge@FreeBSD.org> | 2006-05-09 22:33:43 +0000 |
---|---|---|
committer | tegge <tegge@FreeBSD.org> | 2006-05-09 22:33:43 +0000 |
commit | c0a3325a9b4abc5ab370a1bcad5c2981d0e65afc (patch) | |
tree | 425ce8264d67e9329f1accfa299c93fd41bc9ae4 | |
parent | f7d4a6b03b3e365a6b195691fd0483d357a11451 (diff) | |
download | FreeBSD-src-c0a3325a9b4abc5ab370a1bcad5c2981d0e65afc.zip FreeBSD-src-c0a3325a9b4abc5ab370a1bcad5c2981d0e65afc.tar.gz |
Bring the call to softdep_releasefile() within the region protected by
vn_start_secondary_write() since it might cause file system write activity
(e.g. ffs_snapremove()).
-rw-r--r-- | sys/ufs/ufs/ufs_inode.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/ufs/ufs/ufs_inode.c b/sys/ufs/ufs/ufs_inode.c index b85c9a3..638e23b 100644 --- a/sys/ufs/ufs/ufs_inode.c +++ b/sys/ufs/ufs/ufs_inode.c @@ -83,9 +83,9 @@ ufs_inactive(ap) */ if (ip->i_mode == 0) goto out; - if (ip->i_effnlink == 0 && DOINGSOFTDEP(vp)) - softdep_releasefile(ip); - if (ip->i_nlink <= 0 && (vp->v_mount->mnt_flag & MNT_RDONLY) == 0) { + if ((ip->i_effnlink == 0 && DOINGSOFTDEP(vp)) || + (ip->i_nlink <= 0 && + (vp->v_mount->mnt_flag & MNT_RDONLY) == 0)) { loop: if (vn_start_secondary_write(vp, &mp, V_NOWAIT) != 0) { /* Cannot delete file while file system is suspended */ @@ -112,6 +112,10 @@ ufs_inactive(ap) return (0); } } + } + if (ip->i_effnlink == 0 && DOINGSOFTDEP(vp)) + softdep_releasefile(ip); + if (ip->i_nlink <= 0 && (vp->v_mount->mnt_flag & MNT_RDONLY) == 0) { #ifdef QUOTA if (!getinoquota(ip)) (void)chkiq(ip, -1, NOCRED, FORCE); |