Fix two bugs in extended attribute support for UFS/FFS:

o Put back in {} removed during over-zealous cleanup of gratuitous
  debugging output during preparation for the commit.  Due to the
  missing {}, writes on extended attributes always silently failed.
  Doh.

o Don't unlock the target vnode if it's the backing vnode, as we
  don't lock the target vnode if it's the backing vnode.
This commit is contained in:
Robert Watson 2000-04-16 01:35:30 +00:00
parent 6eb38370fb
commit 33e1f8e541

View File

@ -649,9 +649,10 @@ ufs_extattr_set(struct vnode *vp, char *name, struct uio *uio,
if (error)
goto vopunlock_exit;
if (local_aio.uio_resid != 0)
if (local_aio.uio_resid != 0) {
error = ENXIO;
goto vopunlock_exit;
}
/*
* Write out user data
@ -663,7 +664,9 @@ ufs_extattr_set(struct vnode *vp, char *name, struct uio *uio,
vopunlock_exit:
uio->uio_offset = 0;
VOP_UNLOCK(attribute->uele_backing_vnode, 0, p);
if (attribute->uele_backing_vnode != vp)
VOP_UNLOCK(attribute->uele_backing_vnode, 0, p);
return (error);
}