From e81c5f4307eca5a02d8aac35be0d368b95a6636b Mon Sep 17 00:00:00 2001 From: Robert Watson Date: Tue, 5 Sep 2000 03:15:02 +0000 Subject: [PATCH] o vn_extattr_set() will now call appropriate vn_start_write() and vn_finished_write() if IO_NODELOCKED is not set. Obtained from: TrustedBSD Project --- sys/kern/vfs_vnops.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 3f9a8b1734ae..d45fc7837d82 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -923,6 +923,7 @@ vn_extattr_set(struct vnode *vp, int ioflg, const char *attrname, int buflen, { struct uio auio; struct iovec iov; + struct mount *mp; int error; iov.iov_len = buflen; @@ -936,14 +937,19 @@ vn_extattr_set(struct vnode *vp, int ioflg, const char *attrname, int buflen, auio.uio_offset = 0; auio.uio_resid = buflen; - if ((ioflg & IO_NODELOCKED) == 0) + if ((ioflg & IO_NODELOCKED) == 0) { + if ((error = vn_start_write(vp, &mp, V_WAIT)) != 0) + return (error); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p); + } /* authorize attribute setting as kernel */ error = VOP_SETEXTATTR(vp, attrname, &auio, NULL, p); - if ((ioflg & IO_NODELOCKED) == 0) + if ((ioflg & IO_NODELOCKED) == 0) { + vn_finished_write(mp); VOP_UNLOCK(vp, 0, p); + } return (error); }