Re: [shm][hugetlb] Fix get_policy for stacked shared memory files
From: William Lee Irwin III
Date: Tue Jun 12 2007 - 02:57:29 EST
On Tue, Jun 12, 2007 at 12:20:52AM -0600, Eric W. Biederman wrote:
> Does this perhaps need to be:
>> diff --git a/ipc/shm.c b/ipc/shm.c
>> index 4fefbad..8d2672d 100644
>> --- a/ipc/shm.c
>> +++ b/ipc/shm.c
>> @@ -254,8 +254,10 @@ struct mempolicy *shm_get_policy(struct vm_area_struct
>> *vma, unsigned long addr)
>>
>> + pol = NULL;
>>
>> if (sfd->vm_ops->get_policy)
>> pol = sfd->vm_ops->get_policy(vma, addr);
>> - else
>> + else if (vma->vm_policy && vma->vm_policy->policy != MPOL_DEFAULT)
>> pol = vma->vm_policy;
>> return pol;
Those paths are above the level where shm_get_policy() is called.
It may be that shm_get_policy() doesn't need to recapitulate them
if it's only ever called through such codepaths. It's not clear to
me whether that's intended as an invariant or is coincidental and
not guaranteed for future callsites.
-- wli
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/