[Devel] Re: [RFC][PATCH] Use struct pid reference in autofs rather than pid_t

Sukadev Bhattiprolu sukadev at us.ibm.com
Tue Jan 23 22:55:52 PST 2007


Yuck. My second glance did not catch any problems :-(.

Will fix the ref count and split into two patches.

Thanks,

Suka

Eric W. Biederman [ebiederm at xmission.com] wrote:
| Sukadev Bhattiprolu <sukadev at us.ibm.com> writes:
| 
| > From: Sukadev Bhattiprolu <sukadev at us.ibm.com>
| > Subject: Use struct pid reference in autofs rather than pid_t
| >
| > Make autofs container-friendly by caching struct pid reference rather
| > than pid_t.
| 
| Are autofs and autofs4 so tightly tied they must be converted together?
| If not 2 patches are more appropriate.
| 
| Otherwise I'd say this looks fine at first glance.
| 
| Just note that using struct pid protects from pid wraparound issues when
| dealing with user space so this should also be a small increase in
| correctness as well.
| 
| At second glance this patch is very incorrect.  It is missing get_pid
| and put_pid calls.
| 
| The big difference between struct pid and pid_t values is that
| struct pid is reference counted.
| 
| Your find_pid's should be find_get_pid's and you need the put_pids
| and unmount or whenever those values stop being valid.
| 
| You also didn't take the required locks when using find_pid.
| 
| Eric
_______________________________________________
Containers mailing list
Containers at lists.osdl.org
https://lists.osdl.org/mailman/listinfo/containers




More information about the Devel mailing list