From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Vernet Subject: Re: [PATCH] selftests: cgroup: Fix exception handling in test_memcg_oom_group_score_events() Date: Sun, 26 Mar 2023 16:39:00 -0500 Message-ID: <20230326213900.GJ363182@maniforge> References: <5b7921c9-ee5d-c372-b19b-2701bcf33148@web.de> Mime-Version: 1.0 Return-path: Content-Disposition: inline In-Reply-To: <5b7921c9-ee5d-c372-b19b-2701bcf33148-S0/GAf8tV78@public.gmane.org> List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Markus Elfring Cc: Lorenzo Stoakes , kernel-janitors-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kselftest-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, Jay Kamat , Johannes Weiner , Michal Hocko , Muchun Song , Roman Gushchin , Shakeel Butt , Shuah Khan , Tejun Heo , Zefan Li , cocci-MZpvjPyXg2s@public.gmane.org, LKML On Sun, Mar 26, 2023 at 10:15:31AM +0200, Markus Elfring wrote: [...] > >> > >> Fixes: a987785dcd6c8ae2915460582aebd6481c81eb67 ("Add tests for memory.oom.group") > > > > Fixes what in the what now? > > 1. Check repetition (which can be undesirable) > > 2. Can a cg_destroy() call ever work as expected if a cg_create() call failed? Perhaps next time you can answer your own question by spending 30 seconds actually reading the code you're "fixing": int cg_destroy(const char *cgroup) { int ret; retry: ret = rmdir(cgroup); if (ret && errno == EBUSY) { cg_killall(cgroup); usleep(100); goto retry; } if (ret && errno == ENOENT) <<< that case is explicitly handled here ret = 0; return ret; }