To the correct mailing list.

Begin forwarded message:

> From: Chuck Lever <[email protected]>
> Subject: Re: [PATCH fedfs-utils] nfsref: fix a segmentation fault when lookup 
> a junction
> Date: June 6, 2014 at 9:52:42 AM EDT
> To: Ditang Chen <[email protected]>
> Cc: [email protected]
> 
> Hi Ditang-
> 
> On Jun 6, 2014, at 4:18 AM, Ditang Chen <[email protected]> wrote:
> 
>> Can not retrieve FSN with the fsn_uuid when lookup a junction,the entries 
>> is 1 and the 'tmp' pointer to NULL.
>> 
>> # ls -l
>> total 8
>> d--------T 2 root root 4096 Jun  4 07:05 s2
>> # nsdb-list 
>> NSDB: ldap.example.net:389
>> NCE ou=fedfs,dc=example,dc=net has no FSN records
>> # nfsref lookup s2
>> Segmentation fault
>> 
>> (gdb) bt
>> #0  0x0000000000404eb0 in nfsref_lookup_resolve_fsn (host=0x118d630, 
>> fsn_uuid=<optimized out>) at lookup.c:364
>> #1  nfsref_lookup_nfs_fedfs (junct_path=<optimized out>) at lookup.c:483
>> #2  0x0000000000403cf9 in main (argc=3, argv=0x7fff69dea5e8) at nfsref.c:181
> 
> Yep, that’s a bug, and FEDFS_ERR_NSDB_NOFSN is the correct error to return.
> 
> However, can you copy the logic at the end of nsdb_resolve_fsn_find_entry_s()
> instead?
> 
>> Signed-off-by: [email protected]
>> ---
>> src/libnsdb/fileserver.c | 3 +++
>> 1 file changed, 3 insertions(+)
>> 
>> diff --git a/src/libnsdb/fileserver.c b/src/libnsdb/fileserver.c
>> index 965f1a1..602f469 100644
>> --- a/src/libnsdb/fileserver.c
>> +++ b/src/libnsdb/fileserver.c
>> @@ -1526,6 +1526,9 @@ nsdb_get_fsn_find_entry_s(nsdb_t host, const char 
>> *nce, const char *fsn_uuid,
>>      }
>>      ldap_msgfree(response);
>> 
>> +    if (tmp == NULL)
>> +            return FEDFS_ERR_NSDB_NOFSN;
>> +
>>      if (retval == FEDFS_OK) {
>>              xlog(D_CALL, "%s: returning fsn", __func__);
>>              *fsn = tmp;
>> -- 
>> 1.8.4.2
> 
> --
> Chuck Lever
> chuck[dot]lever[at]oracle[dot]com
> 
> 
> 

--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com




_______________________________________________
fedfs-utils-devel mailing list
[email protected]
https://oss.oracle.com/mailman/listinfo/fedfs-utils-devel

Reply via email to