Hugh Dickins
bb78a92f47
cgroup: fix rmdir EBUSY regression in 3.11
...
On 3.11-rc we are seeing cgroup directories left behind when they should
have been removed. Here's a trivial reproducer:
cd /sys/fs/cgroup/memory
mkdir parent parent/child; rmdir parent/child parent
rmdir: failed to remove `parent': Device or resource busy
It's because cgroup_destroy_locked() (step 1 of destruction) leaves
cgroup on parent's children list, letting cgroup_offline_fn() (step 2 of
destruction) remove it; but step 2 is run by work queue, which may not
yet have removed the children when parent destruction checks the list.
Fix that by checking through a non-empty list of children: if every one
of them has already been marked CGRP_DEAD, then it's safe to proceed:
those children are invisible to userspace, and should not obstruct rmdir.
(I didn't see any reason to keep the cgrp->children checks under the
unrelated css_set_lock, so moved them out.)
tj: Flattened nested ifs a bit and updated comment so that it's
correct on both for-3.11-fixes and for-3.12.
Signed-off-by: Hugh Dickins <hughd@google.com >
Signed-off-by: Tejun Heo <tj@kernel.org >
2013-08-29 11:05:07 -04:00
..
2013-06-14 23:01:05 +02:00
2013-04-30 17:04:10 -07:00
2013-07-18 12:48:40 -07:00
2013-01-11 11:39:33 -08:00
2013-07-13 15:37:30 -07:00
2013-08-14 00:42:05 +02:00
2013-08-06 13:18:12 -07:00
2013-08-13 16:58:17 -07:00
2013-08-28 19:26:38 -07:00
2013-08-02 22:40:09 -04:00
2013-04-22 07:09:06 -07:00
2013-05-04 14:57:58 -04:00
2013-03-12 13:59:14 -07:00
2013-06-12 16:29:46 -07:00
2013-01-11 14:54:55 -08:00
2013-06-12 16:29:45 -07:00
2013-07-09 10:33:19 -07:00
2013-07-09 10:33:19 -07:00
2013-07-09 10:33:19 -07:00
2011-03-23 19:46:28 -07:00
2013-04-14 10:06:31 -07:00
2012-11-19 08:13:38 -08:00
2013-08-29 11:05:07 -04:00
2013-05-01 07:21:43 -07:00
2013-05-01 17:29:18 -04:00
2013-06-20 08:18:35 -10:00
2012-05-31 17:49:27 -07:00
2013-07-14 19:36:59 -04:00
2013-08-21 08:40:27 -04:00
2011-11-06 19:44:47 -08:00
2012-12-18 10:55:28 -08:00
2013-01-27 19:23:31 +01:00
2012-03-28 18:30:03 +01:00
2013-07-09 10:33:26 -07:00
2013-04-15 13:25:16 +02:00
2013-08-13 17:57:48 -07:00
2013-07-30 14:05:06 +02:00
2013-02-23 18:50:11 -08:00
2013-06-25 23:11:19 +02:00
2012-05-03 03:29:33 -07:00
2013-07-14 19:36:59 -04:00
2012-04-25 12:39:25 +02:00
2013-02-05 00:48:46 +01:00
2012-04-10 11:00:30 +02:00
2012-08-06 19:00:35 +03:00
2013-04-15 15:17:26 +09:30
2012-12-20 17:40:19 -08:00
2013-05-28 08:50:00 +02:00
2012-03-23 13:18:57 +01:00
2013-04-30 17:04:07 -07:00
2013-07-03 16:08:02 -07:00
2013-07-03 16:07:46 -07:00
2012-12-11 18:10:49 -08:00
2013-04-30 17:04:02 -07:00
2011-10-31 09:20:12 -04:00
2012-05-29 23:28:41 -04:00
2012-10-24 12:39:09 +02:00
2013-05-12 14:16:21 +02:00
2013-07-31 14:41:03 -07:00
2013-03-15 15:09:43 +10:30
2012-12-20 17:40:21 -08:00
2012-12-05 11:27:24 +10:30
2012-10-19 17:30:40 -07:00
2013-07-10 14:51:41 -07:00
2011-10-31 09:20:12 -04:00
2011-04-14 08:52:33 +02:00
2013-07-30 22:16:40 +02:00
2011-04-14 08:52:33 +02:00
2011-10-31 09:20:12 -04:00
2013-05-01 17:29:39 -04:00
2012-12-06 17:16:23 +08:00
2013-07-11 09:02:09 -07:00
2013-07-02 15:38:19 +09:30
2013-05-01 17:51:54 -07:00
2013-07-03 16:08:05 -07:00
2013-07-03 16:54:42 +02:00
2013-04-18 12:51:19 +02:00
2013-07-14 19:36:59 -04:00
2013-08-06 13:16:32 -07:00
2013-06-18 11:32:10 -05:00
2013-01-28 22:06:21 -08:00
2013-06-10 13:46:44 -07:00
2013-06-10 13:45:53 -07:00
2013-06-10 13:45:53 -07:00
2013-07-14 19:36:58 -04:00
2013-07-14 19:36:58 -04:00
2013-05-05 00:16:35 -04:00
2013-07-14 19:36:58 -04:00
2013-07-14 19:36:58 -04:00
2013-07-09 10:33:29 -07:00
2013-07-14 19:36:59 -04:00
2012-12-18 15:02:12 -08:00
2013-07-03 16:08:06 -07:00
2011-01-27 21:13:51 -05:00
2013-02-07 20:51:08 +01:00
2013-04-10 14:48:37 +02:00
2013-05-28 09:23:52 +02:00
2013-03-23 15:53:52 -07:00
2013-03-26 11:07:19 +11:00
2013-04-30 17:04:08 -07:00
2013-05-12 14:16:23 +02:00
2013-07-14 19:36:59 -04:00
2013-07-14 19:36:59 -04:00
2012-08-13 17:01:07 +02:00
2013-07-14 19:36:59 -04:00
2012-03-23 13:18:57 +01:00
2013-02-07 15:19:36 -08:00
2011-10-31 09:20:12 -04:00
2013-02-26 22:25:17 +01:00
2013-05-09 13:46:38 -04:00
2013-07-09 10:33:29 -07:00
2013-06-26 18:01:46 +09:00
2013-07-26 14:22:10 -07:00
2012-09-13 16:47:34 +02:00
2012-10-06 03:05:31 +09:00
2013-04-29 18:28:42 -07:00
2013-06-19 12:58:42 +02:00
2013-02-16 23:17:25 +01:00
2013-07-14 19:36:59 -04:00
2013-04-29 13:55:38 -07:00
2013-01-27 19:23:31 +01:00
2013-03-03 22:58:33 -05:00
2011-10-31 09:20:12 -04:00
2013-08-08 13:11:39 -07:00
2013-02-27 19:10:24 -08:00
2013-05-01 17:51:54 -07:00
2013-02-27 19:10:22 -08:00
2013-05-01 17:29:39 -04:00
2013-08-19 09:08:54 -07:00
2013-06-20 15:46:32 +02:00
2013-06-19 12:58:42 +02:00
2013-08-06 13:58:34 -07:00