[PATCH] Re: [Samba] SYSVOL ACLs and GPOs

simo idra at samba.org
Fri Oct 26 17:02:04 MDT 2012


On Sat, 2012-10-27 at 09:24 +1100, Andrew Bartlett wrote:
> +                       } else if (errno == ERANGE && requested_len <
> 49060) {
> +                               requested_len += 4096; /* Just guess,
> this isn't meant to happen! */ 

Why this arbitrary 49060 number ?

IIRC XFS supports 64k sized xattrs

I would say you should use a define somewhere so the max size can be
changed.

Also I am not sure what's the point of 'adding' 4096 to requested_len ?
Wouldn't it make more sense to start with the maximum and then halve the
value until a minimum at each iteration ?

I find it unlikely that if the function returns an error after you
guessed a size too large, that it will returning anything different if
you increase the size.

Finally the current code will reallocated buf over and over without
freeing it, it is true that it allocates on mem_ctx so it is not
technically a leak, but it is ugly to have all those useless buffers
around.

Simo.

-- 
Simo Sorce
Samba Team GPL Compliance Officer <simo at samba.org>
Principal Software Engineer at Red Hat, Inc. <simo at redhat.com>



More information about the samba-technical mailing list