Message ID | 20230312224250.425727-1-vincenzopalazzodev@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp913428wrd; Sun, 12 Mar 2023 16:11:55 -0700 (PDT) X-Google-Smtp-Source: AK7set//CGTNfPWN1QoA1YgU5PrpfFE3aef66m8MTcto+usScVZJQOxJdvkwMjOFZ2fXbHWt9kbr X-Received: by 2002:a17:90a:3d4e:b0:23b:3b3a:54c2 with SMTP id o14-20020a17090a3d4e00b0023b3b3a54c2mr4375560pjf.48.1678662714829; Sun, 12 Mar 2023 16:11:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678662714; cv=none; d=google.com; s=arc-20160816; b=swFn+dec+eX86HT2mvg/f+uquiugkCm0tCI+W4MnDzrbQ8ZSCEP97JLjHyD8gIVeuK M6li5w7Lsu+ffv6/cYBIfrqe240s6W0oHzx3T2hvyBhapqmoU/R4wvVQs1J2dORVr9Te /Wrl3goJGnW6vNyXlxMMH/mJAo9bee89aLKixZLi2ogRJfslKWLASJTk5lRDAtyuSHfm URX8da1TO2T0CsPa/okgtLYePKtN2BAXTjUdRa8TL/IIDh7l1nBfKlmQ2jzHobXMnx6m xo+u8be9tHRiINDxCQhBYWOpePyC0JPPlj2DEHclc+jBlY/szRMwXorfmCtWTs+83Iyh mJ5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=b0ViGEbyFErRvg7Qz/LIg+Zt65cp8EPInnkG8HJXYoM=; b=uBBdj9Rm0XyTKu1om6hNnbWCKJmTpQX9rcVv6XUg0827NbP22vuedsjmfkq3BhBCwZ WyLEHV6TPsH2UFmKzm+hkTULeolF1p7Q/ARmY/OHGNcy05sLHS/w59JyQih/pk7/5Erl d8k6oPXwDzLuX7ycCuzgSzWEc2pAOrM5QDT5HbQY0uW+dxdCSMcEy98Auw9JeHl/CmIY TAaPvsPC5S0IfqssyyI+1qMh9b0P6vV3WpSQgR08oP57PYXA0t2FjNBLr1K0Z2m1rXUL NIWzL13Llwj6laytx3jE1p6071psFuaPTydXVryvpq8kqJI2W+xRQwcm+w2+DhzdUz6C TlPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=oHrvhUBn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x6-20020a17090ad68600b002352eb7b6ecsi5099205pju.80.2023.03.12.16.11.40; Sun, 12 Mar 2023 16:11:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=oHrvhUBn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229723AbjCLWnD (ORCPT <rfc822;realc9580@gmail.com> + 99 others); Sun, 12 Mar 2023 18:43:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229535AbjCLWnB (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 12 Mar 2023 18:43:01 -0400 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62FA986AF for <linux-kernel@vger.kernel.org>; Sun, 12 Mar 2023 15:42:59 -0700 (PDT) Received: by mail-wm1-x32c.google.com with SMTP id j19-20020a05600c191300b003eb3e1eb0caso9708736wmq.1 for <linux-kernel@vger.kernel.org>; Sun, 12 Mar 2023 15:42:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678660977; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=b0ViGEbyFErRvg7Qz/LIg+Zt65cp8EPInnkG8HJXYoM=; b=oHrvhUBnl0o+IC2q/3qYaOvxNruVjAMTtaLY5g2hJNy//RWU/sAxjg5l/Fh36sWDRu h8//7vjugmj6jHAjSuVtpM9PIJiAQtkF9tlfDj8NQUAIf8HA70C7R5tXlm7gAcOVxddi DfOMP4N4h/BYAXysR+vCDTyN6D+j71Q8qz4bXfuU72TEVMyrZ7DZ7t3MZfmWp8y69K71 ln6iUHVgfQmzAVThIT7pR2mUfIFDI5QZOdL8qJoGZzj3uih2oqq3pg++6f4KD3eixIdY zSJcQeMo6XLUgrHXLKG9YDFvTZmviI8osj1mdvmlqe7V3SAjQLmJfgrIWgrvvAHYOc1T HN1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678660977; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=b0ViGEbyFErRvg7Qz/LIg+Zt65cp8EPInnkG8HJXYoM=; b=FEBiHLiIU12hjgcjxxamFHjJSXI3fkdAPSEuMV0Yc/LV6zBtR3GZiiwuP5ewceAacq FxFVK/1i5pe7sG6652Rsvo7e3IdUlmrfb6bey3lKr8qNDQXnSHgo3ooP+TrSeRyseORY Hu9+EOiEsK2mNDEA/zgxSxjitVAAltd8JUwaquA0FxlmA2TCgoEnoKGdJhPPIBl93X6b m9h6VDiI9Wk/IlHrH1+PSX8NRjjBh2+BN+Dca9PFa+zTdkD40HuvXAwI7w48eVVA0URU FMz+DmIoS2jyiBcStD89HnAQMO8Dvmm0nkz5kixGAsXOprmQtqxaXPY89gRg+qyWLnl1 /J+A== X-Gm-Message-State: AO0yUKVGmvncSyW/WiAgsPdbfvfZTWmLtrVu/2S6oyDmHaw6jdSpbWAG w+YAufPLsMqtnmAVhEXh+4gkQin5euEFbg== X-Received: by 2002:a05:600c:3506:b0:3e2:c67:1c7f with SMTP id h6-20020a05600c350600b003e20c671c7fmr8914733wmq.10.1678660977395; Sun, 12 Mar 2023 15:42:57 -0700 (PDT) Received: from localhost.localdomain ([2001:b07:5d37:537d:cd23:cd6e:ae14:44fe]) by smtp.gmail.com with ESMTPSA id o4-20020a5d6844000000b002ce3b31753fsm6137544wrw.26.2023.03.12.15.42.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Mar 2023 15:42:56 -0700 (PDT) From: Vincenzo Palazzo <vincenzopalazzodev@gmail.com> To: linux-kernel@vger.kernel.org Cc: jgg@ziepe.ca, Liam.Howlett@Oracle.com, jhubbard@nvidia.com, david@redhat.com, willy@infradead.org, akpm@linux-foundation.org, linux-kernel-mentees@lists.linuxfoundation.org, Vincenzo Palazzo <vincenzopalazzodev@gmail.com> Subject: [RFC PATCH v1 1/1] linux: mm_types: allow to modified the vm_flags in vm_area_struct Date: Sun, 12 Mar 2023 23:42:50 +0100 Message-Id: <20230312224250.425727-1-vincenzopalazzodev@gmail.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760205434537957409?= X-GMAIL-MSGID: =?utf-8?q?1760205434537957409?= |
Series |
[RFC,v1,1/1] linux: mm_types: allow to modified the vm_flags in vm_area_struct
|
|
Commit Message
Vincenzo Palazzo
March 12, 2023, 10:42 p.m. UTC
With 6.3-rc1 is not possible to build the following drivers
- nvidia, that the compilation returns the following errors
/var/lib/dkms/nvidia/525.89.02/build/nvidia/nv-mmap.c: In function ‘nvidia_mmap_numa’:
/var/lib/dkms/nvidia/525.89.02/build/nvidia/nv-mmap.c:455:19: error: assignment of read-only member ‘vm_flags’
455 | vma->vm_flags |= VM_MIXEDMAP;
| ^~
/var/lib/dkms/nvidia/525.89.02/build/nvidia/nv-mmap.c: In function ‘nvidia_mmap_helper’:
/var/lib/dkms/nvidia/525.89.02/build/nvidia/nv-mmap.c:599:23: error: assignment of read-only member ‘vm_flags’
599 | vma->vm_flags |= VM_IO | VM_PFNMAP | VM_DONTEXPAND;
| ^~
/var/lib/dkms/nvidia/525.89.02/build/nvidia/nv-mmap.c:666:23: error: assignment of read-only member ‘vm_flags’
666 | vma->vm_flags |= (VM_IO | VM_LOCKED | VM_RESERVED);
| ^~
/var/lib/dkms/nvidia/525.89.02/build/nvidia/nv-mmap.c:667:23: error: assignment of read-only member ‘vm_flags’
667 | vma->vm_flags |= (VM_DONTEXPAND | VM_DONTDUMP);
| ^~
/var/lib/dkms/nvidia/525.89.02/build/nvidia/nv-mmap.c:673:23: error: assignment of read-only member ‘vm_flags’
673 | vma->vm_flags &= ~VM_WRITE;
| ^~
/var/lib/dkms/nvidia/525.89.02/build/nvidia/nv-mmap.c:674:23: error: assignment of read-only member ‘vm_flags’
674 | vma->vm_flags &= ~VM_MAYWRITE;
| ^~
/var/lib/dkms/nvidia/525.89.02/build/nvidia/nv-mmap.c: In function ‘nv_encode_caching’:
/var/lib/dkms/nvidia/525.89.02/build/nvidia/nv-mmap.c:353:16: warning: this statement may fall through [-Wimplicit-fallthrough=]
353 | if (NV_ALLOW_CACHING(memory_type))
| ^
/var/lib/dkms/nvidia/525.89.02/build/nvidia/nv-mmap.c:356:9: note: here
356 | default:
| ^~~~~~~
make[2]: *** [scripts/Makefile.build:252: /var/lib/dkms/nvidia/525.89.02/build/nvidia/nv-mmap.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile:2028: /var/lib/dkms/nvidia/525.89.02/build] Error 2
make[1]: Leaving directory '/home/vincenzopalazzo/gittea/linux'
make: *** [Makefile:82: modules] Error 2
------
- vboxhost/7.0.6_OSE where the build fails with the following errors
DKMS make.log for vboxhost-7.0.6_OSE for kernel 6.3.0-rc1-00231-g511e7733223b (x86_64)
Sat Mar 11 04:21:34 PM UTC 2023
CC [M] /var/lib/dkms/vboxhost/7.0.6_OSE/build/vboxnetflt/linux/VBoxNetFlt-linux.o
CC [M] /var/lib/dkms/vboxhost/7.0.6_OSE/build/vboxnetadp/linux/VBoxNetAdp-linux.o
CC [M] /var/lib/dkms/vboxhost/7.0.6_OSE/build/vboxnetflt/VBoxNetFlt.o
CC [M] /var/lib/dkms/vboxhost/7.0.6_OSE/build/vboxdrv/linux/SUPDrv-linux.o
CC [M] /var/lib/dkms/vboxhost/7.0.6_OSE/build/vboxdrv/SUPDrv.o
CC [M] /var/lib/dkms/vboxhost/7.0.6_OSE/build/vboxnetadp/VBoxNetAdp.o
CC [M] /var/lib/dkms/vboxhost/7.0.6_OSE/build/vboxdrv/SUPDrvGip.o
CC [M] /var/lib/dkms/vboxhost/7.0.6_OSE/build/vboxnetflt/SUPR0IdcClient.o
CC [M] /var/lib/dkms/vboxhost/7.0.6_OSE/build/vboxdrv/SUPDrvSem.o
CC [M] /var/lib/dkms/vboxhost/7.0.6_OSE/build/vboxnetflt/SUPR0IdcClientComponent.o
CC [M] /var/lib/dkms/vboxhost/7.0.6_OSE/build/vboxnetflt/linux/SUPR0IdcClient-linux.o
CC [M] /var/lib/dkms/vboxhost/7.0.6_OSE/build/vboxdrv/SUPDrvTracer.o
CC [M] /var/lib/dkms/vboxhost/7.0.6_OSE/build/vboxdrv/SUPLibAll.o
CC [M] /var/lib/dkms/vboxhost/7.0.6_OSE/build/vboxdrv/common/string/strformatrt.o
CC [M] /var/lib/dkms/vboxhost/7.0.6_OSE/build/vboxdrv/combined-agnostic1.o
CC [M] /var/lib/dkms/vboxhost/7.0.6_OSE/build/vboxdrv/combined-agnostic2.o
CC [M] /var/lib/dkms/vboxhost/7.0.6_OSE/build/vboxdrv/combined-os-specific.o
LD [M] /var/lib/dkms/vboxhost/7.0.6_OSE/build/vboxnetadp/vboxnetadp.o
In file included from /var/lib/dkms/vboxhost/7.0.6_OSE/build/vboxdrv/combined-os-specific.c:43:
/var/lib/dkms/vboxhost/7.0.6_OSE/build/vboxdrv/r0drv/linux/memobj-r0drv-linux.c: In function ‘rtR0MemObjNativeLockUser’:
/var/lib/dkms/vboxhost/7.0.6_OSE/build/vboxdrv/r0drv/linux/memobj-r0drv-linux.c:1404:39: error: assignment of read-only member ‘vm_flags’
1404 | papVMAs[rc]->vm_flags |= VM_DONTCOPY | VM_LOCKED;
| ^~
/var/lib/dkms/vboxhost/7.0.6_OSE/build/vboxdrv/r0drv/linux/memobj-r0drv-linux.c: In function ‘rtR0MemObjNativeMapUser’:
/var/lib/dkms/vboxhost/7.0.6_OSE/build/vboxdrv/r0drv/linux/memobj-r0drv-linux.c:1876:35: error: assignment of read-only member ‘vm_flags’
1876 | vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP;
| ^~
make[2]: *** [scripts/Makefile.build:252: /var/lib/dkms/vboxhost/7.0.6_OSE/build/vboxdrv/combined-os-specific.o] Error 1
make[2]: *** Waiting for unfinished jobs....
LD [M] /var/lib/dkms/vboxhost/7.0.6_OSE/build/vboxnetflt/vboxnetflt.o
make[1]: *** [scripts/Makefile.build:494: /var/lib/dkms/vboxhost/7.0.6_OSE/build/vboxdrv] Error 2
make: *** [Makefile:2028: /var/lib/dkms/vboxhost/7.0.6_OSE/build] Error 2
-----
The commands that I use to build these drivers are:
- sudo dkms install --no-depmod nvidia/525.89.02 -k 6.3.0-rc1-00231-g511e7733223b
- sudo dkms install --no-depmod vboxhost/7.0.6_OSE -k 6.3.0-rc1-00231-g511e7733223b
The following commit reverts the const constraint that was added in [1],
and also I tested this patch on my system and all started again as
6.2.2.
[1] https://lore.kernel.org/all/20230126193752.297968-3-surenb@google.com/T/#u
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
---
include/linux/mm_types.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Sun, 12 Mar 2023 23:42:50 +0100 Vincenzo Palazzo <vincenzopalazzodev@gmail.com> 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.
On Sun, Mar 12, 2023 at 11:42:50PM +0100, Vincenzo Palazzo wrote: > With 6.3-rc1 is not possible to build the following drivers > > - nvidia, that the compilation returns the following errors <snip> > - vboxhost/7.0.6_OSE where the build fails with the following errors Out-of-tree code needs to be fixed up all the time, this is their responsibility, not the kernel's responsibility. Please submit changes to their codebases if you rely on these modules. thanks, greg k-h
On Mon Mar 13, 2023 at 1:57 AM CET, Andrew Morton wrote: > On Sun, 12 Mar 2023 23:42:50 +0100 Vincenzo Palazzo <vincenzopalazzodev@gmail.com> 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. Yeah I thought about that! nvidia update as soon as the 6.3 is out, not sure about vboxhost. But let the driver update to this new feature make sense. > > 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. Yeah it is! Regarding giving the possiblity to compile ok (and preserving the previous behavior) look like an interesting thought for kernel API, but am I think that it this is difficult to do? The real things that I'm missing with the new wrapper API is the meaning of the new `vm_flags_t vm_flags`, before the field was only one and it was getting modified, but now the real value is the private one `__vm_flags`, so what is the meaning of the new `vm_flags`? I feel that this question is stupid but I can not avoid do it, otherwise my mind think about it till I will not find an answer :) P.S: regaring the warning at compile time the __deprecated looks a good fit to generate error message, but to me in this particular case do not. Thanks, Vincent.
On Mon, Mar 13, 2023 at 10:25:19AM +0100, Vincenzo Palazzo wrote: > P.S: regaring the warning at compile time the __deprecated looks a good > fit to generate error message, but to me in this particular case do not. __deprecated does not work in the kernel tree, sorry. We have tried that in the past and it just gets ignored. Instead, we fix up all in-kernel users and continue on. thanks, greg k-h
On Mon, Mar 13, 2023 at 2:25 AM Vincenzo Palazzo <vincenzopalazzodev@gmail.com> wrote: > > On Mon Mar 13, 2023 at 1:57 AM CET, Andrew Morton wrote: > > On Sun, 12 Mar 2023 23:42:50 +0100 Vincenzo Palazzo <vincenzopalazzodev@gmail.com> 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. > > Yeah I thought about that! nvidia update as soon as the 6.3 is out, not sure > about vboxhost. But let the driver update to this new feature make sense. > > > > > 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. > > Yeah it is! Regarding giving the possiblity to compile ok (and > preserving the previous behavior) look like an interesting thought for > kernel API, but am I think that it this is difficult to do? > > The real things that I'm missing with the new wrapper API > is the meaning of the new `vm_flags_t vm_flags`, before the > field was only one and it was getting modified, but now the real > value is the private one `__vm_flags`, so what is the meaning of > the new `vm_flags`? Sorry for the delay. I'm on vacation until Wednesday and have limited network access. vm_flags is used as a read-only property so that readers of the flags don't have to change, however flag modifiers should be using new wrapper functions. Fixing the errors in this report should be trivial. For example: vma->vm_flags |= VM_IO | VM_PFNMAP | VM_DONTEXPAND; should be replaced with vm_flags_set(vma, VM_IO | VM_PFNMAP | VM_DONTEXPAND); and vma->vm_flags &= ~VM_MAYWRITE; with vm_flags_clear(vma, VM_MAYWRITE); Thanks, Suren. > > I feel that this question is stupid but I can not avoid do it, otherwise > my mind think about it till I will not find an answer :) > > P.S: regaring the warning at compile time the __deprecated looks a good > fit to generate error message, but to me in this particular case do not. > > Thanks, > > Vincent. >
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 0722859c3647..a354eb60c7e8 100644 --- 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; };