lkml.org 
[lkml]   [2011]   [Jul]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC] ipc: introduce shm_rmid_forced sysctl
On 06/22, Vasiliy Kulikov wrote:
>
> +void exit_shm(struct task_struct *task)
> +{
> + struct nsproxy *nsp = task->nsproxy;
> + struct ipc_namespace *ns;
> +
> + if (!nsp)
> + return;
> + ns = nsp->ipc_ns;
> + if (!ns || !ns->shm_rmid_forced)

This looks confusing, imho. How it is possible that ->nsproxy or
->ipc_ns is NULL?

> + return;
> +
> + /* Destroy all already created segments, but not mapped yet */
> + down_write(&shm_ids(ns).rw_mutex);
> + idr_for_each(&shm_ids(ns).ipcs_idr, &shm_try_destroy_current, ns);
> up_write(&shm_ids(ns).rw_mutex);

Again, I do not pretend I understand ipc/, but it seems we can check
ns->ipc_ids[].in_use != 0 before the slow path, no?

Oleg.



\
 
 \ /
  Last update: 2011-07-04 17:15    [W:0.169 / U:0.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site