Fix warning about sleeping with non-sleepable lock when allocating
"current" from linux_cdev_pager_populate() in the LinuxKPI: Backtrace: witness_debugger() witness_warn() uma_zalloc_arg() malloc() linux_alloc_current() linux_cdev_pager_populate() vm_fault() vm_fault_trap() trap_pfault() trap() calltrap() Suggested by: avg@ MFC after: 1 week Sponsored by: Mellanox Technologies
This commit is contained in:
parent
883b75538f
commit
42f8ef4bf5
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=360621
@ -525,8 +525,6 @@ linux_cdev_pager_populate(vm_object_t vm_obj, vm_pindex_t pidx, int fault_type,
|
||||
struct vm_area_struct *vmap;
|
||||
int err;
|
||||
|
||||
linux_set_current(curthread);
|
||||
|
||||
/* get VM area structure */
|
||||
vmap = linux_cdev_handle_find(vm_obj->handle);
|
||||
MPASS(vmap != NULL);
|
||||
@ -534,6 +532,8 @@ linux_cdev_pager_populate(vm_object_t vm_obj, vm_pindex_t pidx, int fault_type,
|
||||
|
||||
VM_OBJECT_WUNLOCK(vm_obj);
|
||||
|
||||
linux_set_current(curthread);
|
||||
|
||||
down_write(&vmap->vm_mm->mmap_sem);
|
||||
if (unlikely(vmap->vm_ops == NULL)) {
|
||||
err = VM_FAULT_SIGBUS;
|
||||
|
Loading…
Reference in New Issue
Block a user