[PATCH] preallocate result for glfs_realpath in vfs_glusterfs
ira at wakeful.net
Fri Oct 21 08:12:52 UTC 2016
How are we handling older versions of Gluster here?
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
More information about the samba-technical