[PATCH 1/2] cifs: Move string length definitions to uapi
Scott Lovenberg
scott.lovenberg at gmail.com
Thu Jul 25 12:04:14 MDT 2013
On Thu, Jul 25, 2013 at 1:55 PM, Jeff Layton <jlayton at redhat.com> wrote:
>
> On Thu, 25 Jul 2013 13:35:20 -0400
> scott.lovenberg at gmail.com wrote:
>
> > From: Scott Lovenberg <scott.lovenberg at gmail.com>
> > @@ -41,12 +42,8 @@
> > #define MAX_SES_INFO 2
> > #define MAX_TCON_INFO 4
> >
> > -#define MAX_TREE_SIZE (2 + MAX_SERVER_SIZE + 1 + MAX_SHARE_SIZE + 1)
> > +#define MAX_TREE_SIZE (2 + MAX_SERVER_SIZE + 1 + CIFS_MAX_SHARE_LEN + 1)
> > #define MAX_SERVER_SIZE 15
> ^^^^^^^
> This looks wrong too. IIUC, that should be the max length of the
> "server" portion of the field. The fact that MAX_TREE_SIZE is pretty
> long is likely what papers over this...
>
> The userland helper uses NI_MAXHOST for this field, but that's not
> defined in the kernel. Perhaps this should be given a name like
> CIFS_NI_MAXHOST, and expanded to the same size as the mount helper uses
> (1025)?
>
> --
> Jeff Layton <jlayton at redhat.com>
I didn't touch that because I really wasn't sure either. Wouldn't we
want to make that 1024 and add 1 for the null terminator in-line to be
consistent? Other than that, I'm on board with that idea.
--
Peace and Blessings,
-Scott.
More information about the samba-technical
mailing list