Re: [PATCH] pagemap: Add alert to mapping_set_release_always() for mapping with no release_folio

From: Matthew Wilcox
Date: Wed Dec 10 2025 - 16:37:16 EST


On Thu, Dec 11, 2025 at 01:31:04AM +0530, Deepakkumar Karn wrote:
> static inline void mapping_set_release_always(struct address_space *mapping)
> {
> + /* Alert while setting the flag with no release_folio callback */

The comment is superfluous.

> + VM_WARN_ONCE(!mapping->a_ops->release_folio,
> + "Setting AS_RELEASE_ALWAYS with no release_folio");

But you haven't said why we need to do this. Surely the NULL pointer
splat is enough to tell you that you did something stupid?

> set_bit(AS_RELEASE_ALWAYS, &mapping->flags);
> }
>
> --
> 2.52.0
>
>