All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] cifs: Move and expand MAX_SERVER_SIZE
@ 2013-07-25 18:34 scott.lovenberg
       [not found] ` <1374777285-25639-1-git-send-email-scott.lovenberg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: scott.lovenberg @ 2013-07-25 18:34 UTC (permalink / raw)
  To: sfrench; +Cc: linux-cifs, gang.chen, samba-technical, jlayton

From: Scott Lovenberg <scott.lovenberg@gmail.com>

MAX_SERVER_SIZE has been moved to cifs_mount.h and renamed
CIFS_NI_MAXHOST for clarity.  It has been expanded to 1024 as the
previous value of 16 was very short.

Signed-off-by: Scott Lovenberg <scott.lovenberg@gmail.com>
---
 fs/cifs/cifsglob.h                   | 3 +--
 include/uapi/linux/cifs/cifs_mount.h | 1 +
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
index b07b122..2227699 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -42,8 +42,7 @@
 #define MAX_SES_INFO 2
 #define MAX_TCON_INFO 4
 
-#define MAX_TREE_SIZE (2 + MAX_SERVER_SIZE + 1 + CIFS_MAX_SHARE_LEN + 1)
-#define MAX_SERVER_SIZE 15
+#define MAX_TREE_SIZE (2 + CIFS_NI_MAXHOST + 1 + CIFS_MAX_SHARE_LEN + 1)
 
 #define CIFS_MIN_RCV_POOL 4
 
diff --git a/include/uapi/linux/cifs/cifs_mount.h b/include/uapi/linux/cifs/cifs_mount.h
index f7e4aee..a58fc6e 100644
--- a/include/uapi/linux/cifs/cifs_mount.h
+++ b/include/uapi/linux/cifs/cifs_mount.h
@@ -21,5 +21,6 @@
 #define CIFS_MAX_USERNAME_LEN   256 /* reasonable max for current servers */
 #define CIFS_MAX_PASSWORD_LEN   512 /* Windows max seems to be 256 wide chars */
 #define CIFS_MAX_SHARE_LEN      256 /* reasonable max share name length */
+#define CIFS_NI_MAXHOST        1024 /* max host name length */
 
 #endif /* _CIFS_MOUNT_H */
-- 
1.8.1.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 2/2] cifs: Correct comment about domainname length
       [not found] ` <1374777285-25639-1-git-send-email-scott.lovenberg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2013-07-25 18:34   ` scott.lovenberg-Re5JQEeQqe8AvxtiuMwx3w
       [not found]     ` <1374777285-25639-2-git-send-email-scott.lovenberg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  2013-07-25 18:55   ` [PATCH 1/2] cifs: Move and expand MAX_SERVER_SIZE Jeff Layton
  1 sibling, 1 reply; 12+ messages in thread
From: scott.lovenberg-Re5JQEeQqe8AvxtiuMwx3w @ 2013-07-25 18:34 UTC (permalink / raw)
  To: sfrench-eUNUBHrolfbYtjvyW6yDsg
  Cc: Scott Lovenberg, jlayton-H+wXaHxf7aLQT0dZR+AlfA,
	linux-cifs-u79uwXL29TY76Z2rM5mHXA,
	gang.chen-bOixZGp5f+dBDgjK7y7TUQ,
	samba-technical-w/Ol4Ecudpl8XjKLYN78aQ

From: Scott Lovenberg <scott.lovenberg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

CIFS_MAX_DOMAINNAME_LEN is the max length for a domain name, not a fully qualified domain name.

Signed-off-by: Scott Lovenberg <scott.lovenberg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 include/uapi/linux/cifs/cifs_mount.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/uapi/linux/cifs/cifs_mount.h b/include/uapi/linux/cifs/cifs_mount.h
index a58fc6e..d2408ec 100644
--- a/include/uapi/linux/cifs/cifs_mount.h
+++ b/include/uapi/linux/cifs/cifs_mount.h
@@ -17,7 +17,7 @@
 #define _CIFS_MOUNT_H
 
 /* Max string lengths for cifs mounting options. */
-#define CIFS_MAX_DOMAINNAME_LEN 256 /* max fully qualified domain name */
+#define CIFS_MAX_DOMAINNAME_LEN 256 /* max domain name length */
 #define CIFS_MAX_USERNAME_LEN   256 /* reasonable max for current servers */
 #define CIFS_MAX_PASSWORD_LEN   512 /* Windows max seems to be 256 wide chars */
 #define CIFS_MAX_SHARE_LEN      256 /* reasonable max share name length */
-- 
1.8.1.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/2] cifs: Move and expand MAX_SERVER_SIZE
       [not found] ` <1374777285-25639-1-git-send-email-scott.lovenberg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  2013-07-25 18:34   ` [PATCH 2/2] cifs: Correct comment about domainname length scott.lovenberg-Re5JQEeQqe8AvxtiuMwx3w
@ 2013-07-25 18:55   ` Jeff Layton
  1 sibling, 0 replies; 12+ messages in thread
From: Jeff Layton @ 2013-07-25 18:55 UTC (permalink / raw)
  To: scott.lovenberg-Re5JQEeQqe8AvxtiuMwx3w
  Cc: sfrench-eUNUBHrolfbYtjvyW6yDsg,
	linux-cifs-u79uwXL29TY76Z2rM5mHXA,
	gang.chen-bOixZGp5f+dBDgjK7y7TUQ,
	samba-technical-w/Ol4Ecudpl8XjKLYN78aQ

On Thu, 25 Jul 2013 14:34:44 -0400
scott.lovenberg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:

> From: Scott Lovenberg <scott.lovenberg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> 
> MAX_SERVER_SIZE has been moved to cifs_mount.h and renamed
> CIFS_NI_MAXHOST for clarity.  It has been expanded to 1024 as the
> previous value of 16 was very short.
> 
> Signed-off-by: Scott Lovenberg <scott.lovenberg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
>  fs/cifs/cifsglob.h                   | 3 +--
>  include/uapi/linux/cifs/cifs_mount.h | 1 +
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
> index b07b122..2227699 100644
> --- a/fs/cifs/cifsglob.h
> +++ b/fs/cifs/cifsglob.h
> @@ -42,8 +42,7 @@
>  #define MAX_SES_INFO 2
>  #define MAX_TCON_INFO 4
>  
> -#define MAX_TREE_SIZE (2 + MAX_SERVER_SIZE + 1 + CIFS_MAX_SHARE_LEN + 1)
> -#define MAX_SERVER_SIZE 15
> +#define MAX_TREE_SIZE (2 + CIFS_NI_MAXHOST + 1 + CIFS_MAX_SHARE_LEN + 1)
>  
>  #define CIFS_MIN_RCV_POOL 4
>  
> diff --git a/include/uapi/linux/cifs/cifs_mount.h b/include/uapi/linux/cifs/cifs_mount.h
> index f7e4aee..a58fc6e 100644
> --- a/include/uapi/linux/cifs/cifs_mount.h
> +++ b/include/uapi/linux/cifs/cifs_mount.h
> @@ -21,5 +21,6 @@
>  #define CIFS_MAX_USERNAME_LEN   256 /* reasonable max for current servers */
>  #define CIFS_MAX_PASSWORD_LEN   512 /* Windows max seems to be 256 wide chars */
>  #define CIFS_MAX_SHARE_LEN      256 /* reasonable max share name length */
> +#define CIFS_NI_MAXHOST        1024 /* max host name length */
>  
>  #endif /* _CIFS_MOUNT_H */

Looks good.

Reviewed-by: Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/2] cifs: Correct comment about domainname length
       [not found]     ` <1374777285-25639-2-git-send-email-scott.lovenberg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2013-07-26  0:40       ` Chen Gang
       [not found]         ` <51F1C564.5070006-bOixZGp5f+dBDgjK7y7TUQ@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Chen Gang @ 2013-07-26  0:40 UTC (permalink / raw)
  To: scott.lovenberg-Re5JQEeQqe8AvxtiuMwx3w
  Cc: sfrench-eUNUBHrolfbYtjvyW6yDsg, jlayton-H+wXaHxf7aLQT0dZR+AlfA,
	linux-cifs-u79uwXL29TY76Z2rM5mHXA,
	samba-technical-w/Ol4Ecudpl8XjKLYN78aQ

On 07/26/2013 02:34 AM, scott.lovenberg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:
> From: Scott Lovenberg <scott.lovenberg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> 
> CIFS_MAX_DOMAINNAME_LEN is the max length for a domain name, not a fully qualified domain name.
> 
> Signed-off-by: Scott Lovenberg <scott.lovenberg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
>  include/uapi/linux/cifs/cifs_mount.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/uapi/linux/cifs/cifs_mount.h b/include/uapi/linux/cifs/cifs_mount.h
> index a58fc6e..d2408ec 100644
> --- a/include/uapi/linux/cifs/cifs_mount.h
> +++ b/include/uapi/linux/cifs/cifs_mount.h
> @@ -17,7 +17,7 @@
>  #define _CIFS_MOUNT_H
>  
>  /* Max string lengths for cifs mounting options. */
> -#define CIFS_MAX_DOMAINNAME_LEN 256 /* max fully qualified domain name */
> +#define CIFS_MAX_DOMAINNAME_LEN 256 /* max domain name length */
>  #define CIFS_MAX_USERNAME_LEN   256 /* reasonable max for current servers */
>  #define CIFS_MAX_PASSWORD_LEN   512 /* Windows max seems to be 256 wide chars */
>  #define CIFS_MAX_SHARE_LEN      256 /* reasonable max share name length */
> 

For our kernel implementation:

  for 'CIFS_MAX_DOMAINNAME_LEN', it counts 255 + '\0',
  for 'CIFS_MAX_USERNAME_LEN', it counts 256 (may add additional '\0'),

And original mail said about 'CIFS_MAX_DOMAINNAME_LEN':

  "The maximum length of ... the fully qualified domain name (FQDN) is
  63 octets per label and 255 bytes per FQDN. This maximum includes 254
  bytes for the FQDN and one byte for the ending dot."

And excuse me, I do not know what 'CIFS_MAX_USERNAME_LEN' should be.

Do we also need consider about it in our definition comments ?


Thanks.
-- 
Chen Gang

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/2] cifs: Correct comment about domainname length
       [not found]         ` <51F1C564.5070006-bOixZGp5f+dBDgjK7y7TUQ@public.gmane.org>
@ 2013-07-26 18:12           ` Scott Lovenberg
       [not found]             ` <CAFB9KM2zF9m4Y4vcDRkZpMfvWP8NQWYKQTeJTiwgVVVu=4M6Cw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Scott Lovenberg @ 2013-07-26 18:12 UTC (permalink / raw)
  To: Chen Gang
  Cc: sfrench-eUNUBHrolfbYtjvyW6yDsg, Jeff Layton, linux-cifs,
	samba-technical-w/Ol4Ecudpl8XjKLYN78aQ

On Thu, Jul 25, 2013 at 8:40 PM, Chen Gang <gang.chen-bOixZGp5f+dBDgjK7y7TUQ@public.gmane.org> wrote:
> On 07/26/2013 02:34 AM, scott.lovenberg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:
>> From: Scott Lovenberg <scott.lovenberg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>>
>> CIFS_MAX_DOMAINNAME_LEN is the max length for a domain name, not a fully qualified domain name.
>>
>> Signed-off-by: Scott Lovenberg <scott.lovenberg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>> ---
>>  include/uapi/linux/cifs/cifs_mount.h | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/include/uapi/linux/cifs/cifs_mount.h b/include/uapi/linux/cifs/cifs_mount.h
>> index a58fc6e..d2408ec 100644
>> --- a/include/uapi/linux/cifs/cifs_mount.h
>> +++ b/include/uapi/linux/cifs/cifs_mount.h
>> @@ -17,7 +17,7 @@
>>  #define _CIFS_MOUNT_H
>>
>>  /* Max string lengths for cifs mounting options. */
>> -#define CIFS_MAX_DOMAINNAME_LEN 256 /* max fully qualified domain name */
>> +#define CIFS_MAX_DOMAINNAME_LEN 256 /* max domain name length */
>>  #define CIFS_MAX_USERNAME_LEN   256 /* reasonable max for current servers */
>>  #define CIFS_MAX_PASSWORD_LEN   512 /* Windows max seems to be 256 wide chars */
>>  #define CIFS_MAX_SHARE_LEN      256 /* reasonable max share name length */
>>
>
> For our kernel implementation:
>
>   for 'CIFS_MAX_DOMAINNAME_LEN', it counts 255 + '\0',
>   for 'CIFS_MAX_USERNAME_LEN', it counts 256 (may add additional '\0'),
>
> And original mail said about 'CIFS_MAX_DOMAINNAME_LEN':
>
>   "The maximum length of ... the fully qualified domain name (FQDN) is
>   63 octets per label and 255 bytes per FQDN. This maximum includes 254
>   bytes for the FQDN and one byte for the ending dot."
>
> And excuse me, I do not know what 'CIFS_MAX_USERNAME_LEN' should be.
>
> Do we also need consider about it in our definition comments ?
>
>
> Thanks.
> --
> Chen Gang

Sorry, I misunderstood; I figured that it had to be the domain name
without the host since we were allowing a host name that's 1024
characters long.  That documentation should probably be added to the
cifs_mount.h as well then.

Still, how can we have a FQDN that's 256 characters long when the host
name length can be 1024 characters long?

-- 
Peace and Blessings,
-Scott.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/2] cifs: Correct comment about domainname length
       [not found]             ` <CAFB9KM2zF9m4Y4vcDRkZpMfvWP8NQWYKQTeJTiwgVVVu=4M6Cw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2013-07-29  0:27               ` Chen Gang
  2013-07-29  0:36                 ` Richard Sharpe
  0 siblings, 1 reply; 12+ messages in thread
From: Chen Gang @ 2013-07-29  0:27 UTC (permalink / raw)
  To: Scott Lovenberg
  Cc: sfrench-eUNUBHrolfbYtjvyW6yDsg, Jeff Layton, linux-cifs,
	samba-technical-w/Ol4Ecudpl8XjKLYN78aQ

On 07/27/2013 02:12 AM, Scott Lovenberg wrote:
> On Thu, Jul 25, 2013 at 8:40 PM, Chen Gang <gang.chen-bOixZGp5f+dBDgjK7y7TUQ@public.gmane.org> wrote:
>> On 07/26/2013 02:34 AM, scott.lovenberg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:
>>> From: Scott Lovenberg <scott.lovenberg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>>>
>>> CIFS_MAX_DOMAINNAME_LEN is the max length for a domain name, not a fully qualified domain name.
>>>
>>> Signed-off-by: Scott Lovenberg <scott.lovenberg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>>> ---
>>>  include/uapi/linux/cifs/cifs_mount.h | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/include/uapi/linux/cifs/cifs_mount.h b/include/uapi/linux/cifs/cifs_mount.h
>>> index a58fc6e..d2408ec 100644
>>> --- a/include/uapi/linux/cifs/cifs_mount.h
>>> +++ b/include/uapi/linux/cifs/cifs_mount.h
>>> @@ -17,7 +17,7 @@
>>>  #define _CIFS_MOUNT_H
>>>
>>>  /* Max string lengths for cifs mounting options. */
>>> -#define CIFS_MAX_DOMAINNAME_LEN 256 /* max fully qualified domain name */
>>> +#define CIFS_MAX_DOMAINNAME_LEN 256 /* max domain name length */
>>>  #define CIFS_MAX_USERNAME_LEN   256 /* reasonable max for current servers */
>>>  #define CIFS_MAX_PASSWORD_LEN   512 /* Windows max seems to be 256 wide chars */
>>>  #define CIFS_MAX_SHARE_LEN      256 /* reasonable max share name length */
>>>
>>
>> For our kernel implementation:
>>
>>   for 'CIFS_MAX_DOMAINNAME_LEN', it counts 255 + '\0',
>>   for 'CIFS_MAX_USERNAME_LEN', it counts 256 (may add additional '\0'),
>>
>> And original mail said about 'CIFS_MAX_DOMAINNAME_LEN':
>>
>>   "The maximum length of ... the fully qualified domain name (FQDN) is
>>   63 octets per label and 255 bytes per FQDN. This maximum includes 254
>>   bytes for the FQDN and one byte for the ending dot."
>>
>> And excuse me, I do not know what 'CIFS_MAX_USERNAME_LEN' should be.
>>
>> Do we also need consider about it in our definition comments ?
>>
>>
>> Thanks.
>> --
>> Chen Gang
> 
> Sorry, I misunderstood; I figured that it had to be the domain name
> without the host since we were allowing a host name that's 1024
> characters long.  That documentation should probably be added to the
> cifs_mount.h as well then.
> 
> Still, how can we have a FQDN that's 256 characters long when the host
> name length can be 1024 characters long?
> 

Excuse me, I am not quite familiar about cifs, so can not provide
additional more information (I found it only by reading code).

But I feel, it really need additional discussion and check by the
related experts (related members who are familiar with cifs).

Welcome any members' suggestions and completions.

Thanks.
-- 
Chen Gang

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/2] cifs: Correct comment about domainname length
  2013-07-29  0:27               ` Chen Gang
@ 2013-07-29  0:36                 ` Richard Sharpe
       [not found]                   ` <CACyXjPxffbb8VQ55mCWTCP-GDivijXVkHNwtkVTwgAmi1XMyQQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Richard Sharpe @ 2013-07-29  0:36 UTC (permalink / raw)
  To: Chen Gang; +Cc: sfrench, linux-cifs, samba-technical, Jeff Layton

On Sun, Jul 28, 2013 at 5:27 PM, Chen Gang <gang.chen@asianux.com> wrote:
> On 07/27/2013 02:12 AM, Scott Lovenberg wrote:
>> On Thu, Jul 25, 2013 at 8:40 PM, Chen Gang <gang.chen@asianux.com> wrote:
>>> On 07/26/2013 02:34 AM, scott.lovenberg@gmail.com wrote:
>>>> From: Scott Lovenberg <scott.lovenberg@gmail.com>
>>>>
>>>> CIFS_MAX_DOMAINNAME_LEN is the max length for a domain name, not a fully qualified domain name.
>>>>
>>>> Signed-off-by: Scott Lovenberg <scott.lovenberg@gmail.com>
>>>> ---
>>>>  include/uapi/linux/cifs/cifs_mount.h | 2 +-
>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/include/uapi/linux/cifs/cifs_mount.h b/include/uapi/linux/cifs/cifs_mount.h
>>>> index a58fc6e..d2408ec 100644
>>>> --- a/include/uapi/linux/cifs/cifs_mount.h
>>>> +++ b/include/uapi/linux/cifs/cifs_mount.h
>>>> @@ -17,7 +17,7 @@
>>>>  #define _CIFS_MOUNT_H
>>>>
>>>>  /* Max string lengths for cifs mounting options. */
>>>> -#define CIFS_MAX_DOMAINNAME_LEN 256 /* max fully qualified domain name */
>>>> +#define CIFS_MAX_DOMAINNAME_LEN 256 /* max domain name length */
>>>>  #define CIFS_MAX_USERNAME_LEN   256 /* reasonable max for current servers */
>>>>  #define CIFS_MAX_PASSWORD_LEN   512 /* Windows max seems to be 256 wide chars */
>>>>  #define CIFS_MAX_SHARE_LEN      256 /* reasonable max share name length */
>>>>
>>>
>>> For our kernel implementation:
>>>
>>>   for 'CIFS_MAX_DOMAINNAME_LEN', it counts 255 + '\0',
>>>   for 'CIFS_MAX_USERNAME_LEN', it counts 256 (may add additional '\0'),
>>>
>>> And original mail said about 'CIFS_MAX_DOMAINNAME_LEN':
>>>
>>>   "The maximum length of ... the fully qualified domain name (FQDN) is
>>>   63 octets per label and 255 bytes per FQDN. This maximum includes 254
>>>   bytes for the FQDN and one byte for the ending dot."
>>>
>>> And excuse me, I do not know what 'CIFS_MAX_USERNAME_LEN' should be.
>>>
>>> Do we also need consider about it in our definition comments ?
>>>
>>>
>>> Thanks.
>>> --
>>> Chen Gang
>>
>> Sorry, I misunderstood; I figured that it had to be the domain name
>> without the host since we were allowing a host name that's 1024
>> characters long.  That documentation should probably be added to the
>> cifs_mount.h as well then.
>>
>> Still, how can we have a FQDN that's 256 characters long when the host
>> name length can be 1024 characters long?
>>
>
> Excuse me, I am not quite familiar about cifs, so can not provide
> additional more information (I found it only by reading code).
>
> But I feel, it really need additional discussion and check by the
> related experts (related members who are familiar with cifs).
>
> Welcome any members' suggestions and completions.
>
> Thanks.

Come on guys, enough already. As per here:
https://en.wikipedia.org/wiki/Domain_Name_System

and a comment above the max len of the fully qualified domain name (FQDN) is
63 octets per label and 255 bytes per FQDN. This maximum includes 254
bytes for the FQDN and one byte for the ending dot.

-- 
Regards,
Richard Sharpe
(何以解憂?唯有杜康。--曹操)

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/2] cifs: Correct comment about domainname length
       [not found]                   ` <CACyXjPxffbb8VQ55mCWTCP-GDivijXVkHNwtkVTwgAmi1XMyQQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2013-07-29 18:05                     ` Scott Lovenberg
  2013-07-29 20:17                     ` Jeff Layton
  1 sibling, 0 replies; 12+ messages in thread
From: Scott Lovenberg @ 2013-07-29 18:05 UTC (permalink / raw)
  To: Richard Sharpe
  Cc: Chen Gang, sfrench-eUNUBHrolfbYtjvyW6yDsg, Jeff Layton,
	linux-cifs, samba-technical-w/Ol4Ecudpl8XjKLYN78aQ

On Sun, Jul 28, 2013 at 8:36 PM, Richard Sharpe
<realrichardsharpe-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> On Sun, Jul 28, 2013 at 5:27 PM, Chen Gang <gang.chen-bOixZGp5f+dBDgjK7y7TUQ@public.gmane.org> wrote:
>> On 07/27/2013 02:12 AM, Scott Lovenberg wrote:
>>> On Thu, Jul 25, 2013 at 8:40 PM, Chen Gang <gang.chen-bOixZGp5f+dBDgjK7y7TUQ@public.gmane.org> wrote:
>>>> On 07/26/2013 02:34 AM, scott.lovenberg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:
>>>>> From: Scott Lovenberg <scott.lovenberg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>>>>>
>>>>> CIFS_MAX_DOMAINNAME_LEN is the max length for a domain name, not a fully qualified domain name.
>>>>>
>>>>> Signed-off-by: Scott Lovenberg <scott.lovenberg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>>>>> ---
>>>>>  include/uapi/linux/cifs/cifs_mount.h | 2 +-
>>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>>>
>>>>> diff --git a/include/uapi/linux/cifs/cifs_mount.h b/include/uapi/linux/cifs/cifs_mount.h
>>>>> index a58fc6e..d2408ec 100644
>>>>> --- a/include/uapi/linux/cifs/cifs_mount.h
>>>>> +++ b/include/uapi/linux/cifs/cifs_mount.h
>>>>> @@ -17,7 +17,7 @@
>>>>>  #define _CIFS_MOUNT_H
>>>>>
>>>>>  /* Max string lengths for cifs mounting options. */
>>>>> -#define CIFS_MAX_DOMAINNAME_LEN 256 /* max fully qualified domain name */
>>>>> +#define CIFS_MAX_DOMAINNAME_LEN 256 /* max domain name length */
>>>>>  #define CIFS_MAX_USERNAME_LEN   256 /* reasonable max for current servers */
>>>>>  #define CIFS_MAX_PASSWORD_LEN   512 /* Windows max seems to be 256 wide chars */
>>>>>  #define CIFS_MAX_SHARE_LEN      256 /* reasonable max share name length */
>>>>>
>>>>
>>>> For our kernel implementation:
>>>>
>>>>   for 'CIFS_MAX_DOMAINNAME_LEN', it counts 255 + '\0',
>>>>   for 'CIFS_MAX_USERNAME_LEN', it counts 256 (may add additional '\0'),
>>>>
>>>> And original mail said about 'CIFS_MAX_DOMAINNAME_LEN':
>>>>
>>>>   "The maximum length of ... the fully qualified domain name (FQDN) is
>>>>   63 octets per label and 255 bytes per FQDN. This maximum includes 254
>>>>   bytes for the FQDN and one byte for the ending dot."
>>>>
>>>> And excuse me, I do not know what 'CIFS_MAX_USERNAME_LEN' should be.
>>>>
>>>> Do we also need consider about it in our definition comments ?
>>>>
>>>>
>>>> Thanks.
>>>> --
>>>> Chen Gang
>>>
>>> Sorry, I misunderstood; I figured that it had to be the domain name
>>> without the host since we were allowing a host name that's 1024
>>> characters long.  That documentation should probably be added to the
>>> cifs_mount.h as well then.
>>>
>>> Still, how can we have a FQDN that's 256 characters long when the host
>>> name length can be 1024 characters long?
>>>
>>
>> Excuse me, I am not quite familiar about cifs, so can not provide
>> additional more information (I found it only by reading code).
>>
>> But I feel, it really need additional discussion and check by the
>> related experts (related members who are familiar with cifs).
>>
>> Welcome any members' suggestions and completions.
>>
>> Thanks.
>
> Come on guys, enough already. As per here:
> https://en.wikipedia.org/wiki/Domain_Name_System
>
> and a comment above the max len of the fully qualified domain name (FQDN) is
> 63 octets per label and 255 bytes per FQDN. This maximum includes 254
> bytes for the FQDN and one byte for the ending dot.
>
> --
> Regards,
> Richard Sharpe
> (何以解憂?唯有杜康。--曹操)

OK, I'll respin this and resubmit.

-- 
Peace and Blessings,
-Scott.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/2] cifs: Correct comment about domainname length
       [not found]                   ` <CACyXjPxffbb8VQ55mCWTCP-GDivijXVkHNwtkVTwgAmi1XMyQQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2013-07-29 18:05                     ` Scott Lovenberg
@ 2013-07-29 20:17                     ` Jeff Layton
       [not found]                       ` <20130729161709.19c52e0f-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
  1 sibling, 1 reply; 12+ messages in thread
From: Jeff Layton @ 2013-07-29 20:17 UTC (permalink / raw)
  To: Richard Sharpe
  Cc: Chen Gang, sfrench-eUNUBHrolfbYtjvyW6yDsg, linux-cifs,
	samba-technical-w/Ol4Ecudpl8XjKLYN78aQ

On Sun, 28 Jul 2013 17:36:56 -0700
Richard Sharpe <realrichardsharpe-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

> On Sun, Jul 28, 2013 at 5:27 PM, Chen Gang <gang.chen-bOixZGp5f+dBDgjK7y7TUQ@public.gmane.org> wrote:
> > On 07/27/2013 02:12 AM, Scott Lovenberg wrote:
> >> On Thu, Jul 25, 2013 at 8:40 PM, Chen Gang <gang.chen-bOixZGp5f+dBDgjK7y7TUQ@public.gmane.org> wrote:
> >>> On 07/26/2013 02:34 AM, scott.lovenberg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:
> >>>> From: Scott Lovenberg <scott.lovenberg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> >>>>
> >>>> CIFS_MAX_DOMAINNAME_LEN is the max length for a domain name, not a fully qualified domain name.
> >>>>
> >>>> Signed-off-by: Scott Lovenberg <scott.lovenberg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> >>>> ---
> >>>>  include/uapi/linux/cifs/cifs_mount.h | 2 +-
> >>>>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>>>
> >>>> diff --git a/include/uapi/linux/cifs/cifs_mount.h b/include/uapi/linux/cifs/cifs_mount.h
> >>>> index a58fc6e..d2408ec 100644
> >>>> --- a/include/uapi/linux/cifs/cifs_mount.h
> >>>> +++ b/include/uapi/linux/cifs/cifs_mount.h
> >>>> @@ -17,7 +17,7 @@
> >>>>  #define _CIFS_MOUNT_H
> >>>>
> >>>>  /* Max string lengths for cifs mounting options. */
> >>>> -#define CIFS_MAX_DOMAINNAME_LEN 256 /* max fully qualified domain name */
> >>>> +#define CIFS_MAX_DOMAINNAME_LEN 256 /* max domain name length */
> >>>>  #define CIFS_MAX_USERNAME_LEN   256 /* reasonable max for current servers */
> >>>>  #define CIFS_MAX_PASSWORD_LEN   512 /* Windows max seems to be 256 wide chars */
> >>>>  #define CIFS_MAX_SHARE_LEN      256 /* reasonable max share name length */
> >>>>
> >>>
> >>> For our kernel implementation:
> >>>
> >>>   for 'CIFS_MAX_DOMAINNAME_LEN', it counts 255 + '\0',
> >>>   for 'CIFS_MAX_USERNAME_LEN', it counts 256 (may add additional '\0'),
> >>>
> >>> And original mail said about 'CIFS_MAX_DOMAINNAME_LEN':
> >>>
> >>>   "The maximum length of ... the fully qualified domain name (FQDN) is
> >>>   63 octets per label and 255 bytes per FQDN. This maximum includes 254
> >>>   bytes for the FQDN and one byte for the ending dot."
> >>>
> >>> And excuse me, I do not know what 'CIFS_MAX_USERNAME_LEN' should be.
> >>>
> >>> Do we also need consider about it in our definition comments ?
> >>>
> >>>
> >>> Thanks.
> >>> --
> >>> Chen Gang
> >>
> >> Sorry, I misunderstood; I figured that it had to be the domain name
> >> without the host since we were allowing a host name that's 1024
> >> characters long.  That documentation should probably be added to the
> >> cifs_mount.h as well then.
> >>
> >> Still, how can we have a FQDN that's 256 characters long when the host
> >> name length can be 1024 characters long?
> >>
> >
> > Excuse me, I am not quite familiar about cifs, so can not provide
> > additional more information (I found it only by reading code).
> >
> > But I feel, it really need additional discussion and check by the
> > related experts (related members who are familiar with cifs).
> >
> > Welcome any members' suggestions and completions.
> >
> > Thanks.
> 
> Come on guys, enough already. As per here:
> https://en.wikipedia.org/wiki/Domain_Name_System
> 
> and a comment above the max len of the fully qualified domain name (FQDN) is
> 63 octets per label and 255 bytes per FQDN. This maximum includes 254
> bytes for the FQDN and one byte for the ending dot.
> 

Ok, I think I knew that at one point and paged it out. It does make one
wonder why NI_MAXHOST is so big though -- is that for some
internationalization scheme?

-- 
Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/2] cifs: Correct comment about domainname length
       [not found]                       ` <20130729161709.19c52e0f-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
@ 2013-07-29 21:10                         ` Scott Lovenberg
       [not found]                           ` <CAFB9KM3CxJcHdFPrGTW595hjNzvYnLgVA6F8J3EMdddz3n0ivw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Scott Lovenberg @ 2013-07-29 21:10 UTC (permalink / raw)
  To: Jeff Layton
  Cc: Richard Sharpe, Chen Gang, sfrench-eUNUBHrolfbYtjvyW6yDsg,
	linux-cifs, samba-technical-w/Ol4Ecudpl8XjKLYN78aQ

On Mon, Jul 29, 2013 at 4:17 PM, Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
>> >> Still, how can we have a FQDN that's 256 characters long when the host
>> >> name length can be 1024 characters long?
>> >>
>> >
>> > Excuse me, I am not quite familiar about cifs, so can not provide
>> > additional more information (I found it only by reading code).
>> >
>> > But I feel, it really need additional discussion and check by the
>> > related experts (related members who are familiar with cifs).
>> >
>> > Welcome any members' suggestions and completions.
>> >
>> > Thanks.
>>
>> Come on guys, enough already. As per here:
>> https://en.wikipedia.org/wiki/Domain_Name_System
>>
>> and a comment above the max len of the fully qualified domain name (FQDN) is
>> 63 octets per label and 255 bytes per FQDN. This maximum includes 254
>> bytes for the FQDN and one byte for the ending dot.
>>
>
> Ok, I think I knew that at one point and paged it out. It does make one
> wonder why NI_MAXHOST is so big though -- is that for some
> internationalization scheme?
>
> --
> Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

I guess it works if you're storing as UTF-32 or wchar_t at 4 bytes per
character. 256 characters * 4 bytes/char + 1 byte for NULL.  Microsoft
seems to use the same value for NI_MAXHOST ref:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms738532(v=vs.85).aspx
.
-- 
Peace and Blessings,
-Scott.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/2] cifs: Correct comment about domainname length
       [not found]                           ` <CAFB9KM3CxJcHdFPrGTW595hjNzvYnLgVA6F8J3EMdddz3n0ivw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2013-07-30  0:09                             ` Chen Gang
  2013-07-30  0:31                               ` Chen Gang
  0 siblings, 1 reply; 12+ messages in thread
From: Chen Gang @ 2013-07-30  0:09 UTC (permalink / raw)
  To: Scott Lovenberg
  Cc: Jeff Layton, Richard Sharpe, sfrench-eUNUBHrolfbYtjvyW6yDsg,
	linux-cifs, samba-technical-w/Ol4Ecudpl8XjKLYN78aQ

On 07/30/2013 05:10 AM, Scott Lovenberg wrote:
> On Mon, Jul 29, 2013 at 4:17 PM, Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
>>>>> Still, how can we have a FQDN that's 256 characters long when the host
>>>>> name length can be 1024 characters long?
>>>>>
>>>>
>>>> Excuse me, I am not quite familiar about cifs, so can not provide
>>>> additional more information (I found it only by reading code).
>>>>
>>>> But I feel, it really need additional discussion and check by the
>>>> related experts (related members who are familiar with cifs).
>>>>
>>>> Welcome any members' suggestions and completions.
>>>>
>>>> Thanks.
>>>
>>> Come on guys, enough already. As per here:
>>> https://en.wikipedia.org/wiki/Domain_Name_System
>>>
>>> and a comment above the max len of the fully qualified domain name (FQDN) is
>>> 63 octets per label and 255 bytes per FQDN. This maximum includes 254
>>> bytes for the FQDN and one byte for the ending dot.
>>>
>>
>> Ok, I think I knew that at one point and paged it out. It does make one
>> wonder why NI_MAXHOST is so big though -- is that for some
>> internationalization scheme?
>>
>> --
>> Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> 
> I guess it works if you're storing as UTF-32 or wchar_t at 4 bytes per
> character. 256 characters * 4 bytes/char + 1 byte for NULL.  Microsoft
> seems to use the same value for NI_MAXHOST ref:
> http://msdn.microsoft.com/en-us/library/windows/desktop/ms738532(v=vs.85).aspx
> .
> 

As far as I know, the kernel implementation wants to use 255 + 1 as
character count, not bytes count for FQDN (256 bytes for 8-bit, 512
bytes for 16-bit, ...), it can be translated into uni-code or other
format within 255 + 1 character count.

May it be useful for our discussion ?

(BTW: if kernel really wants to do, I also suggest to check the kernel
implementation for it whether correct or not).


Thanks.
-- 
Chen Gang

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/2] cifs: Correct comment about domainname length
  2013-07-30  0:09                             ` Chen Gang
@ 2013-07-30  0:31                               ` Chen Gang
  0 siblings, 0 replies; 12+ messages in thread
From: Chen Gang @ 2013-07-30  0:31 UTC (permalink / raw)
  To: Scott Lovenberg; +Cc: sfrench, linux-cifs, samba-technical, Jeff Layton

On 07/30/2013 08:09 AM, Chen Gang wrote:
> On 07/30/2013 05:10 AM, Scott Lovenberg wrote:
>> On Mon, Jul 29, 2013 at 4:17 PM, Jeff Layton <jlayton@redhat.com> wrote:
>>>>>> Still, how can we have a FQDN that's 256 characters long when the host
>>>>>> name length can be 1024 characters long?
>>>>>>
>>>>>
>>>>> Excuse me, I am not quite familiar about cifs, so can not provide
>>>>> additional more information (I found it only by reading code).
>>>>>
>>>>> But I feel, it really need additional discussion and check by the
>>>>> related experts (related members who are familiar with cifs).
>>>>>
>>>>> Welcome any members' suggestions and completions.
>>>>>
>>>>> Thanks.
>>>>
>>>> Come on guys, enough already. As per here:
>>>> https://en.wikipedia.org/wiki/Domain_Name_System
>>>>
>>>> and a comment above the max len of the fully qualified domain name (FQDN) is
>>>> 63 octets per label and 255 bytes per FQDN. This maximum includes 254
>>>> bytes for the FQDN and one byte for the ending dot.
>>>>
>>>
>>> Ok, I think I knew that at one point and paged it out. It does make one
>>> wonder why NI_MAXHOST is so big though -- is that for some
>>> internationalization scheme?
>>>
>>> --
>>> Jeff Layton <jlayton@redhat.com>
>>
>> I guess it works if you're storing as UTF-32 or wchar_t at 4 bytes per
>> character. 256 characters * 4 bytes/char + 1 byte for NULL.  Microsoft
>> seems to use the same value for NI_MAXHOST ref:
>> http://msdn.microsoft.com/en-us/library/windows/desktop/ms738532(v=vs.85).aspx
>> .
>>
> 
> As far as I know, the kernel implementation wants to use 255 + 1 as
> character count, not bytes count for FQDN (256 bytes for 8-bit, 512
> bytes for 16-bit, ...), it can be translated into uni-code or other
> format within 255 + 1 character count.
> 
> May it be useful for our discussion ?
> 
> (BTW: if kernel really wants to do, I also suggest to check the kernel
> implementation for it whether correct or not).
> 
> 
> Thanks.
> 

OH, sorry, what I said above is incorrect. The kernel implementation use
255 + 1 as bytes, it can be translated into uni-code within 255 + 1
character count.

For NI_MAXHOST, I think we do not mind it: WIKI is more common than
Microsoft. and Microsoft also says: "To simplify determining buffer
requirements ..." (I guess, the "simplify determining" is
"sizeof(UTF-32) * 256 + '\0'").


:-)

Thanks.
-- 
Chen Gang

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2013-07-30  0:31 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-25 18:34 [PATCH 1/2] cifs: Move and expand MAX_SERVER_SIZE scott.lovenberg
     [not found] ` <1374777285-25639-1-git-send-email-scott.lovenberg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-07-25 18:34   ` [PATCH 2/2] cifs: Correct comment about domainname length scott.lovenberg-Re5JQEeQqe8AvxtiuMwx3w
     [not found]     ` <1374777285-25639-2-git-send-email-scott.lovenberg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-07-26  0:40       ` Chen Gang
     [not found]         ` <51F1C564.5070006-bOixZGp5f+dBDgjK7y7TUQ@public.gmane.org>
2013-07-26 18:12           ` Scott Lovenberg
     [not found]             ` <CAFB9KM2zF9m4Y4vcDRkZpMfvWP8NQWYKQTeJTiwgVVVu=4M6Cw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-07-29  0:27               ` Chen Gang
2013-07-29  0:36                 ` Richard Sharpe
     [not found]                   ` <CACyXjPxffbb8VQ55mCWTCP-GDivijXVkHNwtkVTwgAmi1XMyQQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-07-29 18:05                     ` Scott Lovenberg
2013-07-29 20:17                     ` Jeff Layton
     [not found]                       ` <20130729161709.19c52e0f-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2013-07-29 21:10                         ` Scott Lovenberg
     [not found]                           ` <CAFB9KM3CxJcHdFPrGTW595hjNzvYnLgVA6F8J3EMdddz3n0ivw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-07-30  0:09                             ` Chen Gang
2013-07-30  0:31                               ` Chen Gang
2013-07-25 18:55   ` [PATCH 1/2] cifs: Move and expand MAX_SERVER_SIZE Jeff Layton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.