Re: [RFC PATCH v1 1/1] linux: mm_types: allow to modified the vm_flags in vm_area_struct

From: Andrew Morton
Date: Sun Mar 12 2023 - 20:57:12 EST


On Sun, 12 Mar 2023 23:42:50 +0100 Vincenzo Palazzo <vincenzopalazzodev@xxxxxxxxx> wrote:

> With 6.3-rc1 is not possible to build the following drivers

Well, let's cc Suren who actually wrote bc292ab00f6c ("mm: introduce
vma->vm_flags wrapper functions").

> - nvidia, that the compilation returns the following errors
>
> - vboxhost/7.0.6_OSE where the build fails with the following errors
>
> ...
>
> --- a/include/linux/mm_types.h
> +++ b/include/linux/mm_types.h
> @@ -497,7 +497,7 @@ struct vm_area_struct {
> * To modify use vm_flags_{init|reset|set|clear|mod} functions.
> */
> union {
> - const vm_flags_t vm_flags;
> + vm_flags_t vm_flags;
> vm_flags_t __private __vm_flags;
> };

These out-of-tree drivers should be converted to use the wrappers which
bc292ab00f6c added. Their maintainers have a couple of months to do
this before bc292ab00f6c is released in 6.3.

It's unfortunate. I guess it would be better if we were to find a way
to permit these drivers to compile OK but to generate warnings, as an
interim thing for six months or so. Perhaps there's some clever way.