Commit 22636476 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux

Pull module fixes and a virtio block fix from Rusty Russell:
 "Various minor fixes, but a slightly more complex one to fix the
  per-cpu overload problem introduced recently by kvm id changes."

* tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
  module: put modules in list much earlier.
  module: add new state MODULE_STATE_UNFORMED.
  module: prevent warning when finit_module a 0 sized file
  virtio-blk: Don't free ida when disk is in use
parents 3a142ed9 1fb9341a
...@@ -889,6 +889,7 @@ static void virtblk_remove(struct virtio_device *vdev) ...@@ -889,6 +889,7 @@ static void virtblk_remove(struct virtio_device *vdev)
{ {
struct virtio_blk *vblk = vdev->priv; struct virtio_blk *vblk = vdev->priv;
int index = vblk->index; int index = vblk->index;
int refc;
/* Prevent config work handler from accessing the device. */ /* Prevent config work handler from accessing the device. */
mutex_lock(&vblk->config_lock); mutex_lock(&vblk->config_lock);
...@@ -903,10 +904,14 @@ static void virtblk_remove(struct virtio_device *vdev) ...@@ -903,10 +904,14 @@ static void virtblk_remove(struct virtio_device *vdev)
flush_work(&vblk->config_work); flush_work(&vblk->config_work);
refc = atomic_read(&disk_to_dev(vblk->disk)->kobj.kref.refcount);
put_disk(vblk->disk); put_disk(vblk->disk);
mempool_destroy(vblk->pool); mempool_destroy(vblk->pool);
vdev->config->del_vqs(vdev); vdev->config->del_vqs(vdev);
kfree(vblk); kfree(vblk);
/* Only free device id if we don't have any users */
if (refc == 1)
ida_simple_remove(&vd_index_ida, index); ida_simple_remove(&vd_index_ida, index);
} }
......
...@@ -199,11 +199,11 @@ struct module_use { ...@@ -199,11 +199,11 @@ struct module_use {
struct module *source, *target; struct module *source, *target;
}; };
enum module_state enum module_state {
{ MODULE_STATE_LIVE, /* Normal state. */
MODULE_STATE_LIVE, MODULE_STATE_COMING, /* Full formed, running module_init. */
MODULE_STATE_COMING, MODULE_STATE_GOING, /* Going away. */
MODULE_STATE_GOING, MODULE_STATE_UNFORMED, /* Still setting it up. */
}; };
/** /**
......
...@@ -1970,6 +1970,8 @@ static int kdb_lsmod(int argc, const char **argv) ...@@ -1970,6 +1970,8 @@ static int kdb_lsmod(int argc, const char **argv)
kdb_printf("Module Size modstruct Used by\n"); kdb_printf("Module Size modstruct Used by\n");
list_for_each_entry(mod, kdb_modules, list) { list_for_each_entry(mod, kdb_modules, list) {
if (mod->state == MODULE_STATE_UNFORMED)
continue;
kdb_printf("%-20s%8u 0x%p ", mod->name, kdb_printf("%-20s%8u 0x%p ", mod->name,
mod->core_size, (void *)mod); mod->core_size, (void *)mod);
......
This diff is collapsed.
...@@ -55,6 +55,7 @@ static inline unsigned long bug_addr(const struct bug_entry *bug) ...@@ -55,6 +55,7 @@ static inline unsigned long bug_addr(const struct bug_entry *bug)
} }
#ifdef CONFIG_MODULES #ifdef CONFIG_MODULES
/* Updates are protected by module mutex */
static LIST_HEAD(module_bug_list); static LIST_HEAD(module_bug_list);
static const struct bug_entry *module_find_bug(unsigned long bugaddr) static const struct bug_entry *module_find_bug(unsigned long bugaddr)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment