From: Li Zefan Subject: Re: [PATCH for-3.4-fixes] cgroup: cgroup_attach_task() could return -errno after success Date: Fri, 30 Mar 2012 08:37:05 +0800 Message-ID: <4F750031.3090903@huawei.com> References: <20120329160433.GC28941@google.com> <20120329162620.GD28941@google.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7BIT Return-path: In-reply-to: <20120329162620.GD28941-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> Sender: cgroups-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Content-Type: text/plain; charset="us-ascii" To: Tejun Heo Cc: Jiri Kosina , Mandeep Singh Baines , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Paul Menage , Kay Sievers Tejun Heo wrote: > 61d1d219c4 "cgroup: remove extra calls to find_existing_css_set" made > cgroup_task_migrate() return void. An unfortunate side effect was > that cgroup_attach_task() was depending on that function's return > value to clear its @retval on the success path. On cgroup mounts > without any subsystem with ->can_attach() callback, > cgroup_attach_task() ended up returning @retval without initializing > it on success. > > For some reason, gcc failed to warn about it and it didn't cause > cgroup_attach_task() to return non-zero value in many cases, probably > due to difference in register allocation. When the problem > materializes, systemd fails to populate /systemd cgroup mount and > fails to boot. > > Fix it by initializing @retval to zero on declaration. > > Signed-off-by: Tejun Heo > Reported-by: Jiri Kosina > LKML-Reference: Acked-by: Li Zefan