OpenVZ Forum


Home » Mailing lists » Devel » [RFC][PATCH] Use struct pid reference in autofs rather than pid_t
Re: [RFC][PATCH] Use struct pid reference in autofs rather than pid_t [message #17310 is a reply to message #17308] Wed, 24 January 2007 01:36 Go to previous messageGo to previous message
ebiederm is currently offline  ebiederm
Messages: 1354
Registered: February 2006
Senior Member
Sukadev Bhattiprolu <sukadev@us.ibm.com> writes:

> From: Sukadev Bhattiprolu <sukadev@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@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/containers
 
Read Message
Read Message
Read Message
Previous Topic: [PATCHSET] 2.6.20-rc4-mm1-lxc4
Next Topic: + statically-initialize-struct-pid-for-swapper.patch added to -mm tree
Goto Forum:
  


Current Time: Sat Aug 10 18:50:52 GMT 2024

Total time taken to generate the page: 0.02747 seconds