From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751737AbdKFD3x (ORCPT ); Sun, 5 Nov 2017 22:29:53 -0500 Received: from zeniv.linux.org.uk ([195.92.253.2]:51700 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751688AbdKFD3v (ORCPT ); Sun, 5 Nov 2017 22:29:51 -0500 Date: Mon, 6 Nov 2017 03:29:42 +0000 From: Al Viro To: syzbot Cc: akpm@linux-foundation.org, hannes@cmpxchg.org, jack@suse.cz, jlayton@redhat.com, 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 Message-ID: <20171106032941.GR21978@ZenIV.linux.org.uk> References: <94eb2c05f6a018dc21055d39c05b@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <94eb2c05f6a018dc21055d39c05b@google.com> User-Agent: Mutt/1.9.0 (2017-09-02) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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: [] inode_lock > include/linux/fs.h:712 [inline] > (&sb->s_type->i_mutex_key#9){++++}, at: [] > 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: [] > 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.