Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422892Ab3CVSL2 (ORCPT ); Fri, 22 Mar 2013 14:11:28 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:42634 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1422813Ab3CVSL0 (ORCPT ); Fri, 22 Mar 2013 14:11:26 -0400 Date: Fri, 22 Mar 2013 18:11:11 +0000 From: Al Viro To: "J. R. Okajima" Cc: David Howells , Miklos Szeredi , jack@suse.cz, torvalds@linux-foundation.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, hch@infradead.org, akpm@linux-foundation.org, apw@canonical.com, nbd@openwrt.org, neilb@suse.de, jordipujolp@gmail.com, ezk@fsl.cs.sunysb.edu, sedat.dilek@googlemail.com, mszeredi@suse.cz Subject: Re: [PATCH 2/9] vfs: export do_splice_direct() to modules Message-ID: <20130322181111.GP21522@ZenIV.linux.org.uk> References: <1363184193-1796-3-git-send-email-miklos@szeredi.hu> <1363184193-1796-1-git-send-email-miklos@szeredi.hu> <1944.1363525619@warthog.procyon.org.uk> <13789.1363973875@jrobl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <13789.1363973875@jrobl> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1553 Lines: 29 On Sat, Mar 23, 2013 at 02:37:55AM +0900, J. R. Okajima wrote: > > David Howells: > > Now, looking at __sb_start_write(), I'm not entirely sure how the deadlock > > might operate, so it's possible that this is a false alarm. Maybe Jan Kara can > > illuminate further, so I've added him to the cc list. > > It is related to the design of UnionMount, isn't it? > UnionMount is not a filesystem and doen't have its own superblock. > If it was a fs, then > - vfs_truncate() acquires sb_writers for the unioning-fs. > - the unioning-fs may call vfs_truncate() again for the underlying fs. > - this time, sb_writers is for the underlying fs which is a different > sb_writers object from the already acquired one. > So there would be no deadlock. Doesn't help the situation with copyup - witness overlayfs stepping into the same deadlock on copyup. It wants ->i_mutex held on directory in upper layer and it tries to write to file it has created in there. The problem is with the upper layer superblock getting frozen; having a separate one for union is irrelevant. Let me check how aufs does... Aha. Your au_do_copy_file() ends up calling vfs_write() on the file opened in upper layer. And AFAICS it's called with ->i_mutex held on the directory in upper layer, so you've got the same deadlock, sorry. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/