diff options
author | pjd <pjd@FreeBSD.org> | 2006-04-28 21:54:05 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2006-04-28 21:54:05 +0000 |
commit | 3b9d7e4828464eb8072d671a36f1153c902ea3a1 (patch) | |
tree | 71feb9cd12584af8ccff908fb9a9b2293e94c828 | |
parent | bd6b3ab4118497fdf6e7339dda9db5994f6c189f (diff) | |
download | FreeBSD-src-3b9d7e4828464eb8072d671a36f1153c902ea3a1.zip FreeBSD-src-3b9d7e4828464eb8072d671a36f1153c902ea3a1.tar.gz |
vn_start_write() is called only when v_type != VCHR, so corresponding
vn_finished_write() should also be called only then.
BTW. I fixed two functions here: vn_rdwr() and vn_write(). The latter seems
to be unused.
MFC after: 3 weeks
-rw-r--r-- | sys/kern/vfs_vnops.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 752b070..f05abbf 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -404,7 +404,7 @@ vn_rdwr(rw, vp, base, len, offset, segflg, ioflg, active_cred, file_cred, if (auio.uio_resid && error == 0) error = EIO; if ((ioflg & IO_NODELOCKED) == 0) { - if (rw == UIO_WRITE) + if (rw == UIO_WRITE && vp->v_type != VCHR) vn_finished_write(mp); VOP_UNLOCK(vp, 0, td); } @@ -569,7 +569,8 @@ vn_write(fp, uio, active_cred, flags, td) fp->f_offset = uio->uio_offset; fp->f_nextoff = uio->uio_offset; VOP_UNLOCK(vp, 0, td); - vn_finished_write(mp); + if (vp->v_type != VCHR) + vn_finished_write(mp); unlock: VFS_UNLOCK_GIANT(vfslocked); return (error); |