Re: [Devel] [PATCH] sysfs: don't use VE namespace for "dev/char" directory

2017-09-13 Thread Kirill Tkhai

On 12.09.2017 19:12, Stanislav Kinsburskiy wrote:
> Looks like we don't have devices, using it. Or lost some patches.
> Anyway, currently it doesn't work. To make this VE namespace work, "namespace"
> callback has to be added to ve_kobj_type. And this callback has to get VE
> structure from kobject somehow. IOW, device has to be allocated per-ve.
> Another issue here is that it's unclear, how to mark generic devices as
> allocated in VE#0 thus making them visible in VE#0.
> Looks like the whole idea was wrong...
> 
> https://jira.sw.ru/browse/PSBM-71811
> 
> Signed-off-by: Stanislav Kinsburskiy 

Reviewed-by: Kirill Tkhai 

> ---
>  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 80cf3eb..86540d9 100644
> --- a/drivers/base/core.c
> +++ b/drivers/base/core.c
> @@ -1538,7 +1538,7 @@ int __init devices_init(void)
>   sysfs_dev_block_kobj = kobject_create_and_add("block", dev_kobj);
>   if (!sysfs_dev_block_kobj)
>   goto block_kobj_err;
> - sysfs_dev_char_kobj = kobject_create_and_add_ve("char", dev_kobj);
> + sysfs_dev_char_kobj = kobject_create_and_add("char", dev_kobj);
>   if (!sysfs_dev_char_kobj)
>   goto char_kobj_err;
>  
> 
___
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel


Re: [Devel] [RFC PATCH 0/2] autofs: fix autofs_v5_packet dlivery in compat mode

2017-09-13 Thread Ian Kent
On 01/09/17 19:21, Stanislav Kinsburskiy wrote:
> The problem is that in compat mode struct autofs_v5_packet has to have 
> different size
> (i.e. 4 bytes less).

I regret (several times over) my original decision to not make v5 packets
packed 

I have to say the description of the problem is not all that good.

> 
> This is RFC because:
> 1) This issue is hidden, because autofs pipe has O_DIRECT and the rest of the
> epacket is truncated when read.
> 2) X86 arch doesn't have is_compat_task() helper
> 3) It's now clear, what to do if "pgrp" option is specified.

I don't understand what the "pgrp" option has to do with this?

> 
> The following series implements...
> 
> ---
> 
> Stanislav Kinsburskiy (2):
>   autofs: set compat flag on sbi when daemon uses 32bit addressation
>   autofs: sent 32-bit sized packet for 32-bit process
> 
> 
>  fs/autofs4/autofs_i.h  |3 +++
>  fs/autofs4/dev-ioctl.c |3 +++
>  fs/autofs4/inode.c |4 +++-
>  fs/autofs4/waitq.c |5 +
>  4 files changed, 14 insertions(+), 1 deletion(-)
> 

___
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel


Re: [Devel] [RFC PATCH 1/2] autofs: set compat flag on sbi when daemon uses 32bit addressation

2017-09-13 Thread Ian Kent
On 01/09/17 19:21, Stanislav Kinsburskiy wrote:
> Signed-off-by: Stanislav Kinsburskiy 
> ---
>  fs/autofs4/autofs_i.h  |3 +++
>  fs/autofs4/dev-ioctl.c |3 +++
>  fs/autofs4/inode.c |4 +++-
>  3 files changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/autofs4/autofs_i.h b/fs/autofs4/autofs_i.h
> index 4737615..3da105f 100644
> --- a/fs/autofs4/autofs_i.h
> +++ b/fs/autofs4/autofs_i.h
> @@ -120,6 +120,9 @@ struct autofs_sb_info {
>   struct list_head active_list;
>   struct list_head expiring_list;
>   struct rcu_head rcu;
> +#ifdef CONFIG_COMPAT
> + unsigned is32bit:1;
> +#endif
>  };
>  
>  static inline struct autofs_sb_info *autofs4_sbi(struct super_block *sb)
> diff --git a/fs/autofs4/dev-ioctl.c b/fs/autofs4/dev-ioctl.c
> index b7c816f..467d6c4 100644
> --- a/fs/autofs4/dev-ioctl.c
> +++ b/fs/autofs4/dev-ioctl.c
> @@ -397,6 +397,9 @@ static int autofs_dev_ioctl_setpipefd(struct file *fp,
>   sbi->pipefd = pipefd;
>   sbi->pipe = pipe;
>   sbi->catatonic = 0;
> +#ifdef CONFIG_COMPAT
> + sbi->is32bit = is_compat_task();
> +#endif
>   }
>  out:
>   put_pid(new_pid);
> diff --git a/fs/autofs4/inode.c b/fs/autofs4/inode.c
> index 09e7d68..21d3c0b 100644
> --- a/fs/autofs4/inode.c
> +++ b/fs/autofs4/inode.c
> @@ -301,7 +301,9 @@ int autofs4_fill_super(struct super_block *s, void *data, 
> int silent)
>   } else {
>   sbi->oz_pgrp = get_task_pid(current, PIDTYPE_PGID);
>   }
> -
> +#ifdef CONFIG_COMPAT
> + sbi->is32bit = is_compat_task();
> +#endif
>   if (autofs_type_trigger(sbi->type))
>   __managed_dentry_set_managed(root);
>  
> 

Not sure about this.

Don't you think it would be better to avoid the in code #ifdefs by doing some
checks and defines in the header file and defining what's need to just use
is_compat_task().

Not sure 2 patches are needed for this either ..

Ian
___
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel