On Thu 24-08-23 08:11:42, Dave Chinner wrote: > On Wed, Aug 23, 2023 at 12:48:39PM +0200, Jan Kara wrote: > > Convert xfs to use bdev_open_by_path() and pass the handle around. > .... > > > @@ -426,15 +427,15 @@ xfs_shutdown_devices( > > * race, everyone loses. > > */ > > if (mp->m_logdev_targp && mp->m_logdev_targp != mp->m_ddev_targp) { > > - blkdev_issue_flush(mp->m_logdev_targp->bt_bdev); > > - invalidate_bdev(mp->m_logdev_targp->bt_bdev); > > + blkdev_issue_flush(mp->m_logdev_targp->bt_bdev_handle->bdev); > > + invalidate_bdev(mp->m_logdev_targp->bt_bdev_handle->bdev); > > } > > if (mp->m_rtdev_targp) { > > - blkdev_issue_flush(mp->m_rtdev_targp->bt_bdev); > > - invalidate_bdev(mp->m_rtdev_targp->bt_bdev); > > + blkdev_issue_flush(mp->m_rtdev_targp->bt_bdev_handle->bdev); > > + invalidate_bdev(mp->m_rtdev_targp->bt_bdev_handle->bdev); > > } > > - blkdev_issue_flush(mp->m_ddev_targp->bt_bdev); > > - invalidate_bdev(mp->m_ddev_targp->bt_bdev); > > + blkdev_issue_flush(mp->m_ddev_targp->bt_bdev_handle->bdev); > > + invalidate_bdev(mp->m_ddev_targp->bt_bdev_handle->bdev); > > } > > Why do these need to be converted to run through bt_bdev_handle? If > the buftarg is present and we've assigned targp->bt_bdev_handle > during the call to xfs_alloc_buftarg(), then we've assigned > targp->bt_bdev from the handle at the same time, yes? Good point, these conversions are pointless now so I've removed them. They are leftover from a previous version based on a kernel where xfs was dropping bdev references in a different place. Thanks for noticing. Honza -- Jan Kara <jack@xxxxxxxx> SUSE Labs, CR