Skip to content

Commit 61014e9

Browse files
rhvgoyalJens Axboe
authored andcommitted
blkio: deletion of a cgroup was causes oops
o Now a cgroup list of blkg elements can contain blkg from multiple policies. Before sending an unlink event, make sure blkg belongs to they policy. If policy does not own the blkg, do not send update for this blkg. Signed-off-by: Vivek Goyal <vgoyal@redhat.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
1 parent 13f9825 commit 61014e9

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

‎block/blk-cgroup.c‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1411,13 +1411,14 @@ static void blkiocg_destroy(struct cgroup_subsys *subsys, struct cgroup *cgroup)
14111411
/*
14121412
* This blkio_group is being unlinked as associated cgroup is
14131413
* going away. Let all the IO controlling policies know about
1414-
* this event. Currently this is static call to one io
1415-
* controlling policy. Once we have more policies in place, we
1416-
* need some dynamic registration of callback function.
1414+
* this event.
14171415
*/
14181416
spin_lock(&blkio_list_lock);
1419-
list_for_each_entry(blkiop, &blkio_list, list)
1417+
list_for_each_entry(blkiop, &blkio_list, list) {
1418+
if (blkiop->plid != blkg->plid)
1419+
continue;
14201420
blkiop->ops.blkio_unlink_group_fn(key, blkg);
1421+
}
14211422
spin_unlock(&blkio_list_lock);
14221423
} while (1);
14231424

0 commit comments

Comments
 (0)