linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Dmitry Vyukov <dvyukov@google.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>,
	syzbot
	<bot+f99f3a0db9007f4f4e32db54229a240c4fe57c15@syzkaller.appspotmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Johannes Weiner <hannes@cmpxchg.org>, Jan Kara <jack@suse.cz>,
	jlayton@redhat.com, LKML <linux-kernel@vger.kernel.org>,
	linux-mm@kvack.org, npiggin@gmail.com, rgoldwyn@suse.com,
	ross.zwisler@linux.intel.com, syzkaller-bugs@googlegroups.com
Subject: Re: possible deadlock in generic_file_write_iter
Date: Mon, 6 Nov 2017 14:15:44 +0100	[thread overview]
Message-ID: <20171106131544.GB4359@quack2.suse.cz> (raw)
In-Reply-To: <CACT4Y+abiKapoG9ms6RMqNkGBJtjX_Nf5WEQiYJcJ7=XCsyD2w@mail.gmail.com>

On Mon 06-11-17 09:32:35, Dmitry Vyukov wrote:
> On Mon, Nov 6, 2017 at 6:29 AM, Al Viro <viro@zeniv.linux.org.uk> wrote:
> > On Sun, Nov 05, 2017 at 02:25:00AM -0800, syzbot wrote:
> >
> >> loop0/2986 is trying to acquire lock:
> >>  (&sb->s_type->i_mutex_key#9){++++}, at: [<ffffffff8186f9ec>] inode_lock
> >> include/linux/fs.h:712 [inline]
> >>  (&sb->s_type->i_mutex_key#9){++++}, at: [<ffffffff8186f9ec>]
> >> generic_file_write_iter+0xdc/0x7a0 mm/filemap.c:3151
> >>
> >> but now in release context of a crosslock acquired at the following:
> >>  ((complete)&ret.event){+.+.}, at: [<ffffffff822a055e>]
> >> submit_bio_wait+0x15e/0x200 block/bio.c:953
> >>
> >> which lock already depends on the new lock.
> >
> > Almost certainly a false positive...  lockdep can't tell ->i_rwsem of
> > inode on filesystem that lives on /dev/loop0 and that of inode of
> > the backing file of /dev/loop0.
> >
> > Try and put them on different filesystem types and see if you still
> > can reproduce that.  We do have a partial ordering between the filesystems,
> > namely "(parts of) hosting device of X live in a file on Y".  It's
> > going to be acyclic, or you have a much worse problem.  And that's
> > what really orders the things here.
> 
> Should we annotate these inodes with different lock types? Or use
> nesting annotations?

Well, you'd need to have a completely separate set of locking classes for
each filesystem to avoid false positives like these. And that would
increase number of classes lockdep has to handle significantly. So I'm not
sure it's really worth it...

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2017-11-06 13:15 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-05 10:25 syzbot
2017-11-05 10:39 ` Dmitry Vyukov
2017-11-06  3:29 ` Al Viro
2017-11-06  6:32   ` Dmitry Vyukov
2017-11-06 13:15     ` Jan Kara [this message]
2017-11-06 13:33       ` Al Viro
2017-11-06 13:35         ` Dmitry Vyukov
2017-11-06 16:01           ` Peter Zijlstra
2017-11-06 17:36             ` Christoph Hellwig
2017-11-06 23:45               ` Matthew Wilcox
2017-11-07  0:54             ` Byungchul Park
2017-11-07  8:11               ` Peter Zijlstra
2017-11-07  8:18                 ` Dmitry Vyukov
2017-11-07  8:30                 ` Byungchul Park
2017-11-07  8:31                   ` Dmitry Vyukov
2017-11-07  8:42                     ` Byungchul Park

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=20171106131544.GB4359@quack2.suse.cz \
    --to=jack@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=bot+f99f3a0db9007f4f4e32db54229a240c4fe57c15@syzkaller.appspotmail.com \
    --cc=dvyukov@google.com \
    --cc=hannes@cmpxchg.org \
    --cc=jlayton@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=npiggin@gmail.com \
    --cc=rgoldwyn@suse.com \
    --cc=ross.zwisler@linux.intel.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=viro@zeniv.linux.org.uk \
    /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