- Add vop_strategy_pre to validate VOP_STRATEGY locking.
- Disable original vop_strategy lock specification. - Switch to the new vop_strategy_pre for lock validation. VOP_STRATEGY requires only that the buf is locked UNLESS the block numbers need to be translated. There may be other reasons, but as long as the underlying layer uses a VOP to perform the operations they will be caught later.
This commit is contained in:
parent
13e407efee
commit
302c7aaab9
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=99485
@ -253,6 +253,22 @@ vop_rename_pre(void *ap)
|
||||
ASSERT_VOP_LOCKED(a->a_tdvp, "vop_rename: tdvp not locked.\n");
|
||||
}
|
||||
|
||||
void
|
||||
vop_strategy_pre(void *ap)
|
||||
{
|
||||
struct vop_strategy_args *a = ap;
|
||||
int status;
|
||||
|
||||
status = lockstatus(&a->a_bp->b_lock, curthread);
|
||||
|
||||
if (status != LK_SHARED && status != LK_EXCLUSIVE) {
|
||||
if (vfs_badlock_print)
|
||||
printf("VOP_STRATEGY: bp is not locked but should be.\n");
|
||||
if (vfs_badlock_panic)
|
||||
Debugger("Lock violation.\n");
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* DEBUG_VFS_LOCKS */
|
||||
|
||||
void
|
||||
|
@ -524,6 +524,7 @@ do { \
|
||||
} while (0)
|
||||
|
||||
void vop_rename_pre(void *a);
|
||||
void vop_strategy_pre(void *a);
|
||||
|
||||
#else
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user