Re: [PATCH bpf-next v4] bpf: fix lockdep warning triggered by stack_map_get_build_id_offset()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 9/9/21 6:33 AM, Matthew Wilcox wrote:
On Wed, Sep 08, 2021 at 11:02:45PM -0700, Yonghong Song wrote:
@@ -204,9 +204,10 @@ static void stack_map_get_build_id_offset(struct bpf_stack_build_id *id_offs,
  	}
if (!work) {
-		mmap_read_unlock_non_owner(current->mm);
+		mmap_read_unlock(current->mm);
  	} else {
  		work->mm = current->mm;
+		rwsem_release(&current->mm->mmap_lock.dep_map, _RET_IP_);
  		irq_work_queue(&work->irq_work);

This needs a comment before the rwsem_release().  Something like:

		/*
		 * The lock will be released once we're out of interrupt
		 * context.  Tell lockdep that we've released it now so
		 * it doesn't complain that we forgot to release it.
		 */

Thanks! Will add it in the next revision.




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux