Re: [PATCH 2/2] bcache: Convert to lock_cmp_fn

Kent Overstreet
2023-05-25T05:20:30Z

On Wed, May 10, 2023 at 03:01:51PM +0200, Peter Zijlstra wrote:
> > static struct btree *mca_bucket_alloc(struct cache_set *c,
> > struct bkey *k, gfp_t gfp)
> > {
> > @@ -572,7 +593,7 @@ static struct btree *mca_bucket_alloc(struct cache_set *c,
> > return NULL;
> >
> > init_rwsem(&b->lock);
> > - lockdep_set_novalidate_class(&b->lock);
> > + lock_set_cmp_fn(&b->lock, btree_lock_cmp_fn, btree_lock_print_fn);
> > mutex_init(&b->write_lock);
> > lockdep_set_novalidate_class(&b->write_lock);
>
> I can't help but notice you've got yet another novalidate_class usage
> here. What does it take to get rid of that?

A locking rework, probably switching bcache to six locks.

I'd rather prioritize getting bcachefs merged and then working on an
upgrade path from bcache -> bcahcefs so we can depracate bcache,
though...