On Mon, Jul 26, 2010 at 5:44 PM, Balbir Singh <[email protected]> wrote: > On Tue, Jul 6, 2010 at 9:58 AM, Eric Brower <[email protected]> wrote: >> [This patch is of debatable value, given the prior patch to >> cgroup_create_cgroup_from_parent(), and that this is an internal >> function.] >> >> Check for cgroup without controllers to prevent segfault, as the >> current implementation >> depends upon a controller being configured. >> >> Signed-off-by: Eric Brower <[email protected]> > > Hi, Eric > > I could not apply the patches, the patch utilities complain about the > patch being corrupt. Could you please retest on your side? > > Balbir >
My apologies-- let's try this again... [This patch is of debatable value, given the prior patch to cgroup_create_cgroup_from_parent(), and that this is an internal function.] Check for cgroup without controllers to prevent segfault, as the current implementation depends upon a controller being configured. Signed-off-by: Eric Brower <[email protected]> diff -ruPp a/src/api.c b/src/api.c --- a/src/api.c 2010-07-05 11:01:52.680407275 -0700 +++ b/src/api.c 2010-07-05 11:07:44.056406715 -0700 @@ -1502,6 +1502,12 @@ static int cgroup_find_parent(struct cgr *parent = NULL; + /* if cgroup has no controllers attached, consider it unconfigured */ + if (cgroup->controller[0] == NULL) { + cgroup_dbg("cgroup_find_parent called on unconfigured group\n"); + return ECGFAIL; + } + pthread_rwlock_rdlock(&cg_mount_table_lock); controller = cgroup->controller[0]->name; if (!cg_build_path_locked(cgroup->name, child_path, controller)) { -- E ------------------------------------------------------------------------------ The Palm PDK Hot Apps Program offers developers who use the Plug-In Development Kit to bring their C/C++ apps to Palm for a share of $1 Million in cash or HP Products. Visit us here for more details: http://ad.doubleclick.net/clk;226879339;13503038;l? http://clk.atdmt.com/CRS/go/247765532/direct/01/ _______________________________________________ Libcg-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/libcg-devel
