Re: [bug ?] do_get_mempolicy()

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: John Blackwood <john.blackwood@...>
Cc: <linux-kernel@...>, Lee Schermerhorn <lee.schermerhorn@...>, Joe Korty <joe.korty@...>
Date: Thursday, July 3, 2008 - 5:44 pm

On Thu, 3 Jul 2008, John Blackwood wrote:


You're right, the flags member of struct mempolicy has subsequently 
changed to carry "internal" flags that are not supposed to be exposed to 
userspace via the get_mempolicy() API.

The following patch probably fixes it.

Lee?

Signed-off-by: David Rientjes <rientjes@google.com>
---
 mm/mempolicy.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/mm/mempolicy.c b/mm/mempolicy.c
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -729,7 +729,7 @@ static long do_get_mempolicy(int *policy, nodemask_t *nmask,
 	} else {
 		*policy = pol == &default_policy ? MPOL_DEFAULT :
 						pol->mode;
-		*policy |= pol->flags;
+		*policy |= (pol->flags & MPOL_MODE_FLAGS);
 	}
 
 	if (vma) {
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[bug ?] do_get_mempolicy(), John Blackwood, (Thu Jul 3, 4:44 pm)
Re: [bug ?] do_get_mempolicy(), Lee Schermerhorn, (Tue Jul 8, 9:23 am)
Re: [bug ?] do_get_mempolicy(), David Rientjes, (Thu Jul 3, 5:44 pm)
Re: [bug ?] do_get_mempolicy(), Lee Schermerhorn, (Tue Jul 8, 9:43 am)
Re: [bug ?] do_get_mempolicy(), David Rientjes, (Mon Jul 7, 3:05 am)