mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Dave Jones <davej@redhat.com>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>
Cc: Tejun Heo <tj@kernel.org>
Subject: Re: sysfs_bin_mmap lockdep trace.
Date: Wed, 13 Nov 2013 20:10:43 +0000	[thread overview]
Message-ID: <20131113201043.GE13318@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20131113184538.GA7269@redhat.com>

On Wed, Nov 13, 2013 at 01:45:38PM -0500, Dave Jones wrote:
> Al, is this one also known ? Also seen on v3.12-7033-g42a2d923cc34

Umm...  I've seen something like that reported after sysfs merge went in
(right after 3.12), but I hadn't looked into details.

> -> #3 (&mm->mmap_sem){++++++}:

	[sr_block_ioctl() grabs sr_mutex and does copy_from_user() under it]

> -> #2 (sr_mutex){+.+.+.}:
	[sr_block_open() grabs sr_mutex under ->bd_mutex]

> -> #1 (&bdev->bd_mutex){+.+.+.}:
	[sysfs_blk_trace_attr_show() grabs ->bd_mutex and is called under
sysfs_open_file ->mutex]

> -> #0 (&of->mutex){+.+.+.}:
	[sysfs_open_file ->mutex is grabbed by ->mmap()]

Cute...  AFAICS, it came from "sysfs: copy bin mmap support from fs/sysfs/bin.c
to fs/sysfs/file.c".  The first impression is that sysfs_bin_mmap() is
checking for battr->mmap too late, but I'm not sure whether we need of->mutex
to stabilize it...  Tejun, any comments?

  reply	other threads:[~2013-11-13 20:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-13 18:45 Dave Jones
2013-11-13 20:10 ` Al Viro [this message]
2013-11-14  5:41   ` Tejun Heo
2013-11-15  1:19     ` Dave Jones
2013-11-17  2:17       ` [PATCH] sysfs: use a separate locking class for open files depending on mmap Tejun Heo
2013-11-17  3:21         ` Dave Jones
2013-11-17  3:29           ` Tejun Heo
2013-11-18  4:45             ` Greg Kroah-Hartman
2013-11-20  6:30               ` Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131113201043.GE13318@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=davej@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tj@kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®