Upon call of device_destroy_namespace we walk over namespace devices looking for one which match on both device maj/min and VE itself, but the thing is that if device belong to another VE we continue iteration with never released get_device call.
Thus rework the walking routine -- remember the last reference and put it once new iteration is done. https://jira.sw.ru/browse/PSBM-34777 Signed-off-by: Cyrill Gorcunov <gorcu...@virtuozzo.com> CC: Andrey Vagin <ava...@virtuozzo.com> CC: Vladimir Davydov <vdavy...@virtuozzo.com> CC: Konstantin Khorenko <khore...@virtuozzo.com> --- I'm not sure at moment if this indeed address the bug mentioned gonna test it but seems we're having this problem anyway and need to fix it. drivers/base/core.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) Index: linux-pcs7.git/drivers/base/core.c =================================================================== --- linux-pcs7.git.orig/drivers/base/core.c +++ linux-pcs7.git/drivers/base/core.c @@ -1838,15 +1838,12 @@ EXPORT_SYMBOL_GPL(device_destroy); void device_destroy_namespace(struct class *class, dev_t devt, void *ns) { - struct device *dev = NULL; + struct device *dev = NULL, *prev = NULL; - for (;;) { - dev = class_find_device(class, dev, &devt, __match_devt); - if (!dev) - break; - if (!class->namespace || - (class->namespace(dev) == ns)) - break; + for (dev = class_find_device(class, dev, &devt, __match_devt); + dev && (class->namespace && class->namespace(dev) != ns);) { + prev = dev, dev = class_find_device(class, dev, &devt, __match_devt); + put_device(prev); } if (dev) { _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel