[Devel] Re: [PATCH] c/r: support ipc shm regions which are partially mapped

Dan Smith danms at us.ibm.com
Mon Aug 9 11:23:43 PDT 2010


This *almost* fixes it for me.

OL> +	ret = do_shmat_pgoff(shmid, (char __user *) start, shmflg,
OL> +			     &addr, h->vm_end - h->vm_start, h->vm_pgoff);

As discussed on IRC, h->vm_pgoff needs to be <<PAGE_SHIFT'ed here.

Also, since do_shmat_pgoff() checks the inode size and compares it to
the vma size, (h->vm_end - h->vm_start) may not always be correct.  We
should pass the smaller of the inode and vma sizes here.

Other than that, it looks good and works well for me :)

Thanks!

-- 
Dan Smith
IBM Linux Technology Center
email: danms at us.ibm.com
_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list