[PATCH] preallocate result for glfs_realpath in vfs_glusterfs
Anoop C S
anoopcs at redhat.com
Fri Oct 21 08:52:28 UTC 2016
On Fri, 2016-10-21 at 04:12 -0400, Ira Cooper wrote:
> How are we handling older versions of Gluster here?
>
As I mentioned before, glfs_realpath() accepts pre-allocated string passed to it prior to the new
change. So older versions of Gluster should work fine with this change in vfs module.
--Anoop C S.
> -Ira
>
> Sent from a mobile phone. Please treat as any good RFC compliant thing will:
> "Be strict in what you send, but liberal in what you receive."
>
> >
> > On Oct 21, 2016, at 02:36, Michael Adam <obnox at samba.org> wrote:
> >
> > >
> > > On 2016-10-21 at 11:46 +0530, Anoop C S wrote:
> > > >
> > > > On Fri, 2016-10-21 at 00:57 +0200, Michael Adam wrote:
> > > > Hi all,
> > > >
> > > > due to a recent change in glusterfs
> > > > https://review.gluster.org/#/c/15332/ ,
> > > > it is now wrong to just free the result
> > > > of glfs_realpath(). This needs to be discussed,
> > > > but here is a patch that makes us indedpendent
> > > > of the allocation mechanism used by glfs_realpath()
> > > > by handing in a pre-malloced result string.
> > > >
> > > > This is based on discussions I had with
> > > > Rajesh and Anoop today.
> > > >
> > > > Reviews appreciated!
> > > > Rajesh/Anoop, please also confirm this approach!
> > > >
> > >
> > > I can confirm that with this patch smbd no longer segfaults while mounting the share via
> > > Windows,
> > > CIFS and smbclient.
> > >
> > > Since glfs_realpath honours pre-allocated memory this would be the most favourable approach.
> >
> > Thanks for confirming Anoop!
> >
> > Rajesh further pointed out to me that the code should
> > free the pre-allocated string if glfs_realpath fails,
> > which is obviously true.
> >
> > Attached find an updated version of the patch.
> >
> > Cheers - Michael
> >
> > <0001-vfs-glusterfs-preallocate-result-for-glfs_realpath.patch>
More information about the samba-technical
mailing list