Re: [PATCH 2/5] md/raid5: Make is_inactive_blocked() helper

From: Christoph Hellwig
Date: Thu Jul 28 2022 - 10:14:35 EST


On Wed, Jul 27, 2022 at 03:05:57PM -0600, Logan Gunthorpe wrote:
> + int active = atomic_read(&conf->active_stripes);
> +
> + if (list_empty(conf->inactive_list + hash))
> + return false;
> +
> + if (!test_bit(R5_INACTIVE_BLOCKED, &conf->cache_state))
> + return true;
> +
> + return active < (conf->max_nr_stripes * 3 / 4);

Wy does this reed ->active_stripes without even knowing if that is
needed? In fact I don't see the point of the local active variable
at all.