Re: [PATCH 1/4] fs, afs: convert afs_cell.usage from atomic_t to refcount_t

From: David Howells
Date: Wed Feb 22 2017 - 11:16:14 EST


Elena Reshetova <elena.reshetova@xxxxxxxxx> wrote:

> refcount_t type and corresponding API should be
> used instead of atomic_t when the variable is used as
> a reference counter. This allows to avoid accidental
> refcounter overflows that might lead to use-after-free
> situations.

This causes an assertion failure because cells aren't immediately destroyed
when their refcount reaches 0, but may be resurrected provided the cache lock
is held. However, attempting to increment the 0 refcount does nothing, not
even giving a warning.

So please place a hold on this patch. I will check the other AFS patches also.

David