Re: cannot mount tmpfs on 6.3

2018-04-06 Thread Alexander Bluhm
On Thu, Apr 05, 2018 at 11:41:51AM +0200, Patrick Wildt wrote:
> I have seen that issue as well.  I think it's because we are now
> being passed the data and we don't have to do the copyin ourselves.
> When the conversion happened, someone forgot to remove the copyin.
> 
> Does this help?

OK bluhm@

> diff --git a/sys/tmpfs/tmpfs_vfsops.c b/sys/tmpfs/tmpfs_vfsops.c
> index 7fe10c5f00e..b4d671d1160 100644
> --- a/sys/tmpfs/tmpfs_vfsops.c
> +++ b/sys/tmpfs/tmpfs_vfsops.c
> @@ -121,9 +121,6 @@ tmpfs_mount(struct mount *mp, const char *path, void 
> *data,
>   if (tmpfs_mem_info(1) < TMPFS_PAGES_RESERVED)
>   return EINVAL;
>  
> - error = copyin(data, args, sizeof(struct tmpfs_args));
> - if (error)
> - return error;
>   if (args->ta_root_uid == VNOVAL || args->ta_root_gid == VNOVAL ||
>   args->ta_root_mode == VNOVAL)
>   return EINVAL;



Re: cannot mount tmpfs on 6.3

2018-04-05 Thread KAWAMATA Yoshihiro
It worked well.
Very thanks

From: Patrick Wildt <patr...@blueri.se>
Subject: Re: cannot mount tmpfs on 6.3
Date: Thu, 5 Apr 2018 11:41:51 +0200
Message-ID: <20180405094151.GA5797@thor.local>

> I have seen that issue as well.  I think it's because we are now
> being passed the data and we don't have to do the copyin ourselves.
> When the conversion happened, someone forgot to remove the copyin.
> 
> Does this help?
> 
> diff --git a/sys/tmpfs/tmpfs_vfsops.c b/sys/tmpfs/tmpfs_vfsops.c
> index 7fe10c5f00e..b4d671d1160 100644
> --- a/sys/tmpfs/tmpfs_vfsops.c
> +++ b/sys/tmpfs/tmpfs_vfsops.c
> @@ -121,9 +121,6 @@ tmpfs_mount(struct mount *mp, const char *path, void 
> *data,
>   if (tmpfs_mem_info(1) < TMPFS_PAGES_RESERVED)
>   return EINVAL;
>  
> - error = copyin(data, args, sizeof(struct tmpfs_args));
> - if (error)
> - return error;
>   if (args->ta_root_uid == VNOVAL || args->ta_root_gid == VNOVAL ||
>   args->ta_root_mode == VNOVAL)
>   return EINVAL;
> 



Re: cannot mount tmpfs on 6.3

2018-04-05 Thread Patrick Wildt
On Thu, Apr 05, 2018 at 12:20:15PM +0900, KAWAMATA Yoshihiro wrote:
> I built a 6.3 kernel with tmpfs enabled.
> 
> Here's a diff of this kernel with GENERIC:
> 
> # diff -u GENERIC GENERIC_TMPFS
> --- GENERIC Thu Mar 15 03:52:16 2018
> +++ GENERIC_TMPFS   Thu Apr  5 00:56:50 2018
> @@ -11,6 +11,7 @@
>  
>  machineamd64
>  include"../../../conf/GENERIC"
> +option TMPFS   # efficient memory file system
>  maxusers   80  # estimated number of users
>  
>  option USER_PCICONF# user-space PCI configuration
> 
> And I tried to mount tmpfs on this kernel, but it didn't:
> 
> # mount_tmpfs tmpfs /root/mnt_test
> mount_tmpfs: tmpfs on /root/mnt_test: Bad address


I have seen that issue as well.  I think it's because we are now
being passed the data and we don't have to do the copyin ourselves.
When the conversion happened, someone forgot to remove the copyin.

Does this help?

diff --git a/sys/tmpfs/tmpfs_vfsops.c b/sys/tmpfs/tmpfs_vfsops.c
index 7fe10c5f00e..b4d671d1160 100644
--- a/sys/tmpfs/tmpfs_vfsops.c
+++ b/sys/tmpfs/tmpfs_vfsops.c
@@ -121,9 +121,6 @@ tmpfs_mount(struct mount *mp, const char *path, void *data,
if (tmpfs_mem_info(1) < TMPFS_PAGES_RESERVED)
return EINVAL;
 
-   error = copyin(data, args, sizeof(struct tmpfs_args));
-   if (error)
-   return error;
if (args->ta_root_uid == VNOVAL || args->ta_root_gid == VNOVAL ||
args->ta_root_mode == VNOVAL)
return EINVAL;