Skip to content
  • Tejun Heo's avatar
    blkcg: don't allow or retain configuration of missing devices · e56da7e2
    Tejun Heo authored
    
    
    blkcg is very peculiar in that it allows setting and remembering
    configurations for non-existent devices by maintaining separate data
    structures for configuration.
    
    This behavior is completely out of the usual norms and outright
    confusing; furthermore, it uses dev_t number to match the
    configuration to devices, which is unpredictable to begin with and
    becomes completely unuseable if EXT_DEVT is fully used.
    
    It is wholely unnecessary - we already have fully functional userland
    mechanism to program devices being hotplugged which has full access to
    device identification, connection topology and filesystem information.
    
    Add a new struct blkio_group_conf which contains all blkcg
    configurations to blkio_group and let blkio_group, which can be
    created iff the associated device exists and is removed when the
    associated device goes away, carry all configurations.
    
    Note that, after this patch, all newly created blkg's will always have
    the default configuration (unlimited for throttling and blkcg's weight
    for propio).
    
    This patch makes blkio_policy_node meaningless but doesn't remove it.
    The next patch will.
    
    -v2: Updated to retry after short sleep if blkg lookup/creation failed
         due to the queue being temporarily bypassed as indicated by
         -EBUSY return.  Pointed out by Vivek.
    
    Signed-off-by: default avatarTejun Heo <tj@kernel.org>
    Cc: Vivek Goyal <vgoyal@redhat.com>
    Cc: Kay Sievers <kay.sievers@vrfy.org>
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    e56da7e2