Re: [PATCH] fs,block: get holder during claim

Christian Brauner
2024-03-18T08:33:40Z

On Sun, Mar 17, 2024 at 01:53:51PM -0700, Christoph Hellwig wrote:
> On Fri, Mar 15, 2024 at 02:23:07PM +0100, Christian Brauner wrote:
> > Now that we open block devices as files we need to deal with the
> > realities that closing is a deferred operation. An operation on the
> > block device such as e.g., freeze, thaw, or removal that runs
> > concurrently with umount, tries to acquire a stable reference on the
> > holder. The holder might already be gone though. Make that reliable by
> > grabbing a passive reference to the holder during bdev_open() and
> > releasing it during bdev_release().
>
> Looks good:
>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
>
> does bcachefs also need a fix for it's holder ops? Or does it get to
> keep the pieces as it has it's own NULL holder_ops and obviously doens't
> care about getting any of this right?

It has empty holder ops and so is behaving equivalent too having NULL
holder ops. IOW, the block layer cannot access the holder.