nfs-ganesha / ntirpc

New development on tirpc
25 stars 49 forks source link

Where is svc_getargs? #295

Open alllel opened 5 months ago

alllel commented 5 months ago

Trying to replace tirpc with ntirpc I got a problem:

There is no function or macro svc_getargs.

There is only one comment in rpc/svc.h about it:

But no svc_getargs, no SVC_GETARGS is defined elsewhere. What to use instead?

dang commented 5 months ago

You're right, it was removed years ago. Uses were replaced with SVCAUTH_CHECKSUM and SVCAUTH_UNWRAP. The dev who did this hasn't been involved in years, so I'm not sure of the reasoning.

ffilz commented 5 months ago

For some idea of how nfs-ganesha uses ntirpc, here is the call stack from replacing NFSv3 NULL operation argument decode with xdr_void_x that does an assert(false) to force a crash:

#0  0x00007ffff765d292 in raise () from /lib64/libc.so.6
#1  0x00007ffff76468a4 in abort () from /lib64/libc.so.6
#2  0x00007ffff7646789 in __assert_fail_base.cold () from /lib64/libc.so.6
#3  0x00007ffff7655a16 in __assert_fail () from /lib64/libc.so.6
#4  0x00007ffff7d98f63 in xdr_void_x (xdrs=0x7fffe4a00000, unused=0x7fffe4a07830) at /home/ffilz/ganesha/review/src/MainNFSD/nfs_worker_thread.c:85
#5  0x00007ffff7d01ad9 in svcauth_none_checksum (req=0x7fffe4a07000) at /home/ffilz/ganesha/review/src/libntirpc/src/svc_auth_none.c:62
#6  0x00007ffff7d99ba1 in nfs_rpc_process_request (reqdata=0x7fffe4a07000, retry=false) at /home/ffilz/ganesha/review/src/MainNFSD/nfs_worker_thread.c:1012
#7  0x00007ffff7d9c001 in nfs_rpc_valid_NFS (req=0x7fffe4a07000) at /home/ffilz/ganesha/review/src/MainNFSD/nfs_worker_thread.c:1749
#8  0x00007ffff7d0cdec in svc_vc_decode (req=0x7fffe4a07000) at /home/ffilz/ganesha/review/src/libntirpc/src/svc_vc.c:1087
#9  0x00007ffff7d07e3c in svc_request (xprt=0x7fffeee0c000, xdrs=0x7fffe4a00000) at /home/ffilz/ganesha/review/src/libntirpc/src/svc_rqst.c:1201
#10 0x00007ffff7d0cce8 in svc_vc_recv (xprt=0x7fffeee0c000) at /home/ffilz/ganesha/review/src/libntirpc/src/svc_vc.c:1060
#11 0x00007ffff7d07dbc in svc_rqst_xprt_task_recv (wpe=0x7fffeee0c2c8) at /home/ffilz/ganesha/review/src/libntirpc/src/svc_rqst.c:1182
#12 0x00007ffff7d0898b in svc_rqst_epoll_loop (wpe=0x7ffff6abe718) at /home/ffilz/ganesha/review/src/libntirpc/src/svc_rqst.c:1563
#13 0x00007ffff7d1497f in work_pool_thread (arg=0x7fffe9800000) at /home/ffilz/ganesha/review/src/libntirpc/src/work_pool.c:187
#14 0x00007ffff781f299 in start_thread () from /lib64/libpthread.so.0
#15 0x00007ffff77206a3 in clone () from /lib64/libc.so.6

That should be a good guideline to use the Ganesha code to understand how to use ntirpc.