Use a shared lock for VOP_GETEXTATTR, as it is a read-like operation.
MFC after: 1 week
This commit is contained in:
parent
937c916587
commit
926cd204c7
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=248933
@ -326,7 +326,7 @@ extattr_get_vp(struct vnode *vp, int attrnamespace, const char *attrname,
|
||||
size_t size, *sizep;
|
||||
int error;
|
||||
|
||||
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
|
||||
vn_lock(vp, LK_SHARED | LK_RETRY);
|
||||
|
||||
/*
|
||||
* Slightly unusual semantics: if the user provides a NULL data
|
||||
|
@ -1758,7 +1758,7 @@ vn_extattr_get(struct vnode *vp, int ioflg, int attrnamespace,
|
||||
auio.uio_resid = *buflen;
|
||||
|
||||
if ((ioflg & IO_NODELOCKED) == 0)
|
||||
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
|
||||
vn_lock(vp, LK_SHARED | LK_RETRY);
|
||||
|
||||
ASSERT_VOP_LOCKED(vp, "IO_NODELOCKED with no vp lock held");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user