Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4fbd8d1 commit c0ee554Copy full SHA for c0ee554
kernel/pid.c
@@ -193,10 +193,8 @@ struct pid *alloc_pid(struct pid_namespace *ns)
193
}
194
195
if (unlikely(is_child_reaper(pid))) {
196
- if (pid_ns_prepare_proc(ns)) {
197
- disable_pid_allocation(ns);
+ if (pid_ns_prepare_proc(ns))
198
goto out_free;
199
- }
200
201
202
get_pid_ns(ns);
@@ -226,6 +224,10 @@ struct pid *alloc_pid(struct pid_namespace *ns)
226
224
while (++i <= ns->level)
227
225
idr_remove(&ns->idr, (pid->numbers + i)->nr);
228
+ /* On failure to allocate the first pid, reset the state */
+ if (ns->pid_allocated == PIDNS_ADDING)
229
+ idr_set_cursor(&ns->idr, 0);
230
+
231
spin_unlock_irq(&pidmap_lock);
232
233
kmem_cache_free(ns->pid_cachep, pid);
0 commit comments