summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_extattr.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2000-07-28 19:52:38 +0000
committerrwatson <rwatson@FreeBSD.org>2000-07-28 19:52:38 +0000
commitbf8742e138d6b936e74e9d6cc2c60fef4b0374ed (patch)
tree8226510479d76ef3f1e10c2d7947283e921a82f4 /sys/kern/vfs_extattr.c
parent7a8dd71192f90ec9aff5a28011b329e3468c1d4d (diff)
downloadFreeBSD-src-bf8742e138d6b936e74e9d6cc2c60fef4b0374ed.zip
FreeBSD-src-bf8742e138d6b936e74e9d6cc2c60fef4b0374ed.tar.gz
o Modify extattr_{set,get}() syscalls so that partial reads and writes
with an error condition such as EINTR, EWOULDBLOCK, and ERESTART, are reported to the application, not silently conceal. This behavior was copied from the {read,write}v() syscalls, and is appropriate there but not here. o Correct a bug in extattr_delete() wherein the LOCKLEAF flag is passed to the wrong argument in namei(), resulting in some unexpected errors during name resolution, and passing in an unlocked vnode. Obtained from: TrustedBSD Project
Diffstat (limited to 'sys/kern/vfs_extattr.c')
-rw-r--r--sys/kern/vfs_extattr.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c
index d305c39..3a15d64 100644
--- a/sys/kern/vfs_extattr.c
+++ b/sys/kern/vfs_extattr.c
@@ -3586,9 +3586,11 @@ extattr_set_file(p, uap)
cnt = auio.uio_resid;
error = VOP_SETEXTATTR(nd.ni_vp, attrname, &auio, p->p_cred->pc_ucred,
p);
+ /*
if (auio.uio_resid != cnt && (error == ERESTART ||
error == EINTR || error == EWOULDBLOCK))
error = 0;
+ */
cnt -= auio.uio_resid;
p->p_retval[0] = cnt;
done:
@@ -3656,9 +3658,11 @@ extattr_get_file(p, uap)
cnt = auio.uio_resid;
error = VOP_GETEXTATTR(nd.ni_vp, attrname, &auio, p->p_cred->pc_ucred,
p);
+ /*
if (auio.uio_resid != cnt && (error == ERESTART ||
error == EINTR || error == EWOULDBLOCK))
error = 0;
+ */
cnt -= auio.uio_resid;
p->p_retval[0] = cnt;
done:
@@ -3685,7 +3689,7 @@ extattr_delete_file(p, uap)
error = copyin(SCARG(uap, attrname), attrname, EXTATTR_MAXNAMELEN);
if (error)
return(error);
- NDINIT(&nd, LOOKUP | LOCKLEAF, FOLLOW, UIO_USERSPACE,
+ NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE,
SCARG(uap, path), p);
if ((error = namei(&nd)) != 0)
return(error);
OpenPOWER on IntegriCloud