[Devel] [PATCH 13/13] drivers/core/sysfs: respect ns when removing sys dev link

Konstantin Khorenko khorenko at virtuozzo.com
Fri Apr 16 10:35:40 MSK 2021


If we decide to rework "vzctl console" feature and won't create
per-CT ttys, this patch can be dropped.

So not applying it right now, but made a note in https://jira.sw.ru/browse/PSBM-83150

--
Best regards,

Konstantin Khorenko,
Virtuozzo Linux Kernel Team

On 04/14/2021 10:58 AM, Alexander Mikhalitsyn wrote:
> From: Vladimir Davydov <vdavydov at parallels.com>
>
> There is two methods to remove sysfs links - sysfs_delete_link and
> sysfs_remove_link. The difference between them is that one is ns-aware
> while the other isn't. Since we want to create per-ve ttys using
> device_add/device_del we have to use ns-aware one, otherwise we'll get
> EEXIST error on ve start.
>
> https://jira.sw.ru/browse/PSBM-25801
>
> Signed-off-by: Vladimir Davydov <vdavydov at parallels.com>
> Acked-by: Stanislav Kinsbursky <skinsbursky at parallels.com>
>
> ===
>
> VZ 8 rebase part https://jira.sw.ru/browse/PSBM-127782
>
> Signed-off-by: Alexander Mikhalitsyn <alexander.mikhalitsyn at virtuozzo.com>
> ---
>  drivers/base/core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/base/core.c b/drivers/base/core.c
> index 426b3d4430ff..1e692e0639a8 100644
> --- a/drivers/base/core.c
> +++ b/drivers/base/core.c
> @@ -1824,7 +1824,7 @@ static void device_remove_sys_dev_entry(struct device *dev)
>
>  	if (kobj) {
>  		format_dev_t(devt_str, dev->devt);
> -		sysfs_remove_link(kobj, devt_str);
> +		sysfs_delete_link(kobj, &dev->kobj, devt_str);
>  	}
>  }
>
>


More information about the Devel mailing list