Add locking assertions into vn_extattr_set, vn_extattr_get and
vn_extattr_rm. This is meant to catch conditions where IO_NODELOCKED has been specified without the vnode being locked. Discussed with: rwatson MFC after: 1 week
This commit is contained in:
parent
aa2fe60500
commit
cd13819433
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=142348
@ -1080,6 +1080,8 @@ vn_extattr_get(struct vnode *vp, int ioflg, int attrnamespace,
|
||||
if ((ioflg & IO_NODELOCKED) == 0)
|
||||
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
|
||||
|
||||
ASSERT_VOP_LOCKED(vp, "IO_NODELOCKED with no vp lock held");
|
||||
|
||||
/* authorize attribute retrieval as kernel */
|
||||
error = VOP_GETEXTATTR(vp, attrnamespace, attrname, &auio, NULL, NULL,
|
||||
td);
|
||||
@ -1123,6 +1125,8 @@ vn_extattr_set(struct vnode *vp, int ioflg, int attrnamespace,
|
||||
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
|
||||
}
|
||||
|
||||
ASSERT_VOP_LOCKED(vp, "IO_NODELOCKED with no vp lock held");
|
||||
|
||||
/* authorize attribute setting as kernel */
|
||||
error = VOP_SETEXTATTR(vp, attrnamespace, attrname, &auio, NULL, td);
|
||||
|
||||
@ -1147,6 +1151,8 @@ vn_extattr_rm(struct vnode *vp, int ioflg, int attrnamespace,
|
||||
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
|
||||
}
|
||||
|
||||
ASSERT_VOP_LOCKED(vp, "IO_NODELOCKED with no vp lock held");
|
||||
|
||||
/* authorize attribute removal as kernel */
|
||||
error = VOP_DELETEEXTATTR(vp, attrnamespace, attrname, NULL, td);
|
||||
if (error == EOPNOTSUPP)
|
||||
|
Loading…
Reference in New Issue
Block a user