linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mmap: EINVAL not ENOMEM when rejecting VM_GROWS
@ 2012-03-06 20:28 Hugh Dickins
  0 siblings, 0 replies; only message in thread
From: Hugh Dickins @ 2012-03-06 20:28 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Al Viro, Andrew Morton, linux-kernel, linux-mm

Currently error is -ENOMEM when rejecting VM_GROWSDOWN|VM_GROWSUP
from shared anonymous: hoist the file case's -EINVAL up for both.

Signed-off-by: Hugh Dickins <hughd@google.com>
---

 mm/mmap.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- 3.3.0-rc6+/mm/mmap.c	2012-03-05 16:38:23.741975593 -0800
+++ linux/mm/mmap.c	2012-03-06 12:14:32.704674576 -0800
@@ -1266,8 +1266,9 @@ munmap_back:
 	vma->vm_pgoff = pgoff;
 	INIT_LIST_HEAD(&vma->anon_vma_chain);
 
+	error = -EINVAL;	/* when rejecting VM_GROWSDOWN|VM_GROWSUP */
+
 	if (file) {
-		error = -EINVAL;
 		if (vm_flags & (VM_GROWSDOWN|VM_GROWSUP))
 			goto free_vma;
 		if (vm_flags & VM_DENYWRITE) {

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-03-06 20:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-06 20:28 [PATCH] mmap: EINVAL not ENOMEM when rejecting VM_GROWS Hugh Dickins

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox