HAST: unix socket issue

Mikolaj Golub to.my.trociny at gmail.com
Tue Feb 8 22:58:48 UTC 2011


Currently hastd on termination does not remove control socket file. This is
because of the bug in uds_accept(): in accept() it passes the old sockaddr
instead of the new one. As a result sun_path is reseted in the initial socket
while sockaddr for the new socket is left uninitialized. See the attached

Later when unlink is called on a socket close it fails because the path is
empty or some garbage.

But after fixing this issue another problem shows up, which is masked by the
first bug: in the child process we close all unneeded descriptors. For a unix
socket uds_close() will unlink the socket file, which we still need for
parent. E.g. control socket file will be removed on a worker start.

It looks like we need some way to tell uds_close() not to remove the file in
such cases, e.g. setting a flag in socket structure before proto_close() or
adding proto_close_without_unlink() (can't think out a good name :-)

Mikolaj Golub

-------------- next part --------------
A non-text attachment was scrubbed...
Name: proto_uds.c.uds_accept.patch
Type: text/x-patch
Size: 508 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-fs/attachments/20110208/d882e0b7/proto_uds.c.uds_accept.bin

More information about the freebsd-fs mailing list