[Ocfs2-devel] [PATCH 1/6] Add clustername to cluster connection

Goldwyn Rodrigues rgoldwyn at suse.de
Sun Nov 3 19:43:25 PST 2013


On 11/03/2013 04:09 PM, Mark Fasheh wrote:
> On Fri, Oct 18, 2013 at 09:45:12AM -0500, Goldwyn Rodrigues wrote:
>> diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
>> index 121da2d..c30ad6b 100644
>> --- a/fs/ocfs2/super.c
>> +++ b/fs/ocfs2/super.c
>> @@ -2225,9 +2225,9 @@ static int ocfs2_initialize_super(struct super_block *sb,
>>   	if (ocfs2_clusterinfo_valid(osb)) {
>>   		osb->osb_stackflags =
>>   			OCFS2_RAW_SB(di)->s_cluster_info.ci_stackflags;
>> -		memcpy(osb->osb_cluster_stack,
>> +		strlcpy(osb->osb_cluster_stack,
>>   		       OCFS2_RAW_SB(di)->s_cluster_info.ci_stack,
>> -		       OCFS2_STACK_LABEL_LEN);
>> +		       OCFS2_STACK_LABEL_LEN + 1);
>>   		osb->osb_cluster_stack[OCFS2_STACK_LABEL_LEN] = '\0';
>
> I don't think we want to NULL terminate like this any more, right?
>

Right. strlcpy() does the NULL termination for us.

> Otherwise the rest of this looks reasonable to me.
> 	--Mark
>
> --
> Mark Fasheh
>


-- 
Goldwyn



More information about the Ocfs2-devel mailing list