diff options
author | Kirk McKusick <mckusick@FreeBSD.org> | 2001-04-25 08:11:18 +0000 |
---|---|---|
committer | Kirk McKusick <mckusick@FreeBSD.org> | 2001-04-25 08:11:18 +0000 |
commit | 112f737245c52f3064ace38ba0330b6110643cba (patch) | |
tree | 426cf063565af6317b3b723bc81be1e49e9802fd /sys/kern/vfs_vnops.c | |
parent | e69b2bc11c2a03849fc99a92a4a000cc6ae05b02 (diff) | |
download | src-112f737245c52f3064ace38ba0330b6110643cba.tar.gz src-112f737245c52f3064ace38ba0330b6110643cba.zip |
When closing the last reference to an unlinked file, it is freed
by the inactive routine. Because the freeing causes the filesystem
to be modified, the close must be held up during periods when the
filesystem is suspended.
For snapshots to be consistent across crashes, they must write
blocks that they copy and claim those written blocks in their
on-disk block pointers before the old blocks that they referenced
can be allowed to be written.
Close a loophole that allowed unwritten blocks to be skipped when
doing ffs_sync with a request to wait for all I/O activity to be
completed.
Notes
Notes:
svn path=/head/; revision=75943
Diffstat (limited to 'sys/kern/vfs_vnops.c')
-rw-r--r-- | sys/kern/vfs_vnops.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 98da01a373fa..62407fee071f 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -235,6 +235,15 @@ vn_close(vp, flags, cred, p) if (flags & FWRITE) vp->v_writecount--; error = VOP_CLOSE(vp, flags, cred, p); + /* + * XXX - In certain instances VOP_CLOSE has to do the vrele + * itself. If the vrele has been done, it will return EAGAIN + * to indicate that the vrele should not be done again. When + * this happens, we just return success. The correct thing to + * do would be to have all VOP_CLOSE instances do the vrele. + */ + if (error == EAGAIN) + return (0); vrele(vp); return (error); } |