Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 May 2020 09:35:42 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r361201 - stable/12/sys/compat/linuxkpi/common/src
Message-ID:  <202005180935.04I9Zg7H071329@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Mon May 18 09:35:42 2020
New Revision: 361201
URL: https://svnweb.freebsd.org/changeset/base/361201

Log:
  MFC r360621:
  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@
  Sponsored by:	Mellanox Technologies

Modified:
  stable/12/sys/compat/linuxkpi/common/src/linux_compat.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/compat/linuxkpi/common/src/linux_compat.c
==============================================================================
--- stable/12/sys/compat/linuxkpi/common/src/linux_compat.c	Mon May 18 09:34:41 2020	(r361200)
+++ stable/12/sys/compat/linuxkpi/common/src/linux_compat.c	Mon May 18 09:35:42 2020	(r361201)
@@ -528,14 +528,14 @@ linux_cdev_pager_populate(vm_object_t vm_obj, vm_pinde
 	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);
 	MPASS(vmap->vm_private_data == vm_obj->handle);
 
 	VM_OBJECT_WUNLOCK(vm_obj);
+
+	linux_set_current(curthread);
 
 	down_write(&vmap->vm_mm->mmap_sem);
 	if (unlikely(vmap->vm_ops == NULL)) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202005180935.04I9Zg7H071329>