From: Christoph Hellwig Subject: Re: [PATCH 03/19] fs: release anon dev_t in deactivate_locked_super Date: Tue, 26 Sep 2023 11:31:29 +0200 Message-ID: <20230926093129.GA13806@lst.de> References: <20230913111013.77623-1-hch@lst.de> <20230913111013.77623-4-hch@lst.de> <20230913232712.GC800259@ZenIV> <20230914023705.GH800259@ZenIV> <20230914053843.GI800259@ZenIV> <20230914-zielt-einzog-00389009b293@brauner> Mime-Version: 1.0 Return-path: Content-Disposition: inline In-Reply-To: <20230914-zielt-einzog-00389009b293@brauner> List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Christian Brauner Cc: Al Viro , Christoph Hellwig , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Fenghua Yu , Reinette Chatre , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Dennis Dalessandro , Tejun Heo , Trond Myklebust , Anna Schumaker , Kees Cook , Damien Le Moal , Naohiro Aota , Greg Kroah-Hartman , linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-fy+rA21nqHI@public.gmane.org On Thu, Sep 14, 2023 at 09:56:57AM +0200, Christian Brauner wrote: > > BTW, this part of commit message in 2c18a63b760a is rather confused: > > Recent rework moved block device closing out of sb->put_super() and into > > sb->kill_sb() to avoid deadlocks as s_umount is held in put_super() and > > blkdev_put() can end up taking s_umount again. > > > > That was *NOT* what a recent rework had done. Block device closing had never > > been inside ->put_super() - at no point since that (closing, that is) had been > > introduced back in 0.97 ;-) ->put_super() predates it (0.95c+). > > I think the commit message probably just isn't clear enough. The main > block device of a superblock isn't closed in sb->put_super(). That's > always been closed in kill_block_super() after generic_shutdown_super(). Yes. > But afaict filesystem like ext4 and xfs may have additional block > devices open exclusively and closed them in sb->put_super(): > > xfs_fs_put_super() > -> xfs_close_devices() > -> xfs_blkdev_put() > -> blkdev_put() > > ext4_put_super() > -> ext4_blkdev_remove() > -> blkdev_put() Yes.