[Gluster-users] The continuing story ...

Stephan von Krawczynski skraw at ithnet.com
Thu Sep 10 12:07:52 UTC 2009


> > Only if backed up. Has the trace been shown to the linux developers? 
> > What do they think?

Maybe we should just ask questions about the source before bothering others...

>From 2.0.6 /transport/socket/src/socket.c line 867 ff:

                        new_trans = CALLOC (1, sizeof (*new_trans));
                        new_trans->xl = this->xl;
                        new_trans->fini = this->fini;

                        memcpy (&new_trans->peerinfo.sockaddr, &new_sockaddr,
                                addrlen);
                        new_trans->peerinfo.sockaddr_len = addrlen;

                        new_trans->myinfo.sockaddr_len =
                                sizeof (new_trans->myinfo.sockaddr);

                        ret = getsockname (new_sock,
                                           SA (&new_trans->myinfo.sockaddr),
                                           &new_trans->myinfo.sockaddr_len);

CALLOC from libglusterfs/src/mem-pool.h:
#define CALLOC(cnt,size) calloc(cnt,size)

man calloc:
RETURN VALUE
       For calloc() and malloc(), the value returned is a pointer to the allocated memory, which is suitably aligned for any
       kind of variable, or NULL if the request fails.


Did I understand the source? What about calloc returning NULL?

-- 
Regards,
Stephan




More information about the Gluster-users mailing list