On 6/16/17 4:38 PM, William Allen Simpson wrote:
Tried to talk to DanG today, but he went home earlier than usual.  So
maybe somebody else knows:

void Create_SVCXPRTs(void)
{
     protos p;

     LogFullDebug(COMPONENT_DISPATCH, "Allocation of the SVCXPRT");
     for (p = P_NFS; p < P_COUNT; p++)
         if (nfs_protocol_enabled(p)) {
             Create_udp(p);
             Create_tcp(p);
         }
#ifdef RPC_VSOCK
     if (vsock)
         create_vsock();
#endif /* RPC_VSOCK */
}

This creates a UDP VSOCK fd, a TCP VSOCK fd, and then another TCP VSOCK
fd.  I'm fairly sure the the current code won't work properly for the
UDP VSOCK, and I'm fairly sure that two TCP VSOCKs won't be used.

Answering my own question here, nfs_protocol_enabled(p) isn't true, so it
doesn't get allocated here.  The code to do it was a red herring, and
I'll remove it.  I don't know why the loop didn't just say < P_NFS_VSOCK.

So, only one TCP.  No UDP.  That's good.

Allocate_sockets()

        for (p = P_NFS; p < P_COUNT; p++) {
                if (nfs_protocol_enabled(p)) {
                        /* Initialize all the sockets to -1 because
                         * it makes some code later easier */
                        udp_socket[p] = -1;
                        tcp_socket[p] = -1;

Doesn't set the unused sockets to -1.

close_rpc_fd(void)
{
        protos p;

        for (p = P_NFS; p < P_COUNT; p++) {
                if (udp_socket[p] != -1)
                        close(udp_socket[p]);
                if (tcp_socket[p] != -1)
                        close(tcp_socket[p]);
        }

Doesn't check nfs_protocol_enabled(p), so tries to close the sockets.

This also conflicts with the v2.5 (ntirpc v1.5) change to use
SVC_XPRT_FLAG_CLOSE on SVC_DESTROY().

In fact, it might be better to use SVC_DESTROY() on the existing
SVCXPRT *udp_xprt[P_COUNT];
SVCXPRT *tcp_xprt[P_COUNT];

Unused ones should be NULL, so easier test.

Anyway, this is probably a bug that needs to be fixed for v2.5 stable.


Also, VSOCK only needs to support NFS v3 and v4, not the other programs?

This part still needs to be answered.  Some things in the code suggest
that only v4 is supported.  But I'm still guessing.  Is that the intent?

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Nfs-ganesha-devel mailing list
Nfs-ganesha-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs-ganesha-devel

Reply via email to