xfs: close the external block devices in xfs_mount_free
authorChristoph Hellwig <hch@lst.de>
Wed, 9 Aug 2023 22:05:38 +0000 (15:05 -0700)
committerChristian Brauner <brauner@kernel.org>
Thu, 10 Aug 2023 08:34:54 +0000 (10:34 +0200)
commit35a93b148b0363dca23c3db1cc9d48100eb8b276
treed7cf3ee01ec49c0903f2450aaebfafdc6b0cfc41
parent41233576e9a4515dc9b0bd1cbbb896b520a1f486
xfs: close the external block devices in xfs_mount_free

blkdev_put must not be called under sb->s_umount to avoid a lock order
reversal with disk->open_mutex.  Move closing the buftargs into ->kill_sb
to archive that.  Note that the flushing of the disk caches and
block device mapping invalidated needs to stay in ->put_super as the main
block device is closed in kill_block_super already.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Message-Id: <20230809220545.1308228-7-hch@lst.de>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/xfs/xfs_buf.c
fs/xfs/xfs_super.c