From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1765398AbYD1CPk (ORCPT ); Sun, 27 Apr 2008 22:15:40 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754174AbYD1CPd (ORCPT ); Sun, 27 Apr 2008 22:15:33 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:40855 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753684AbYD1CPc (ORCPT ); Sun, 27 Apr 2008 22:15:32 -0400 Date: Mon, 28 Apr 2008 03:15:31 +0100 From: Al Viro To: Dave Young Cc: linux-kernel@vger.kernel.org, jens.axboe@oracle.com Subject: Re: [PATCH 2/2] loop : Don't hold the lo_ctl_mutex while fput in loop_clr_fd Message-ID: <20080428021531.GA5882@ZenIV.linux.org.uk> References: <20080428021022.GB2698@darkstar.te-china.tietoenator.com> <20080428021309.GZ5882@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080428021309.GZ5882@ZenIV.linux.org.uk> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 28, 2008 at 03:13:09AM +0100, Al Viro wrote: > On Mon, Apr 28, 2008 at 10:10:22AM +0800, Dave Young wrote: > > [Fixing bug 10504] > > > > If the bakingfile is a block device file, losetuo -d will trigger lockdep > > warning of "circular locking dependency". > > > > open/release lock order : bdev->bd_mutex ---> lo->lo_ctl_mutex > > loop_clr_fd lock order : lo->lo_ctl_mutex ---> bdev->bd_mutex (fput) > > > > Don't hold the lo_ctl_mutex while fput in loop_clr_fd to fix it. It's safe > > because all loop device state will be consistent here. > > Explain. BTW, explain also why open() at that spot will not do interesting things wrt BLKRRPART done a bit below, please.