Menu

#73 rpc.rquotad does not support IPv6

None
closed-fixed
Jan Kara
None
5
2017-09-05
2011-01-12
No

$ rpcinfo
program version netid address service owner
[...]
100011 1 udp 0.0.0.0.3.107 rquotad superuser
100011 2 udp 0.0.0.0.3.107 rquotad superuser
100011 1 tcp 0.0.0.0.3.107 rquotad superuser
100011 2 tcp 0.0.0.0.3.107 rquotad superuser

# mount -o quota,vers=4 [::1]:/mnt/quotaext3/ /mnt/nfs/quotaext3/

$ grep vers=4 /proc/mounts
::1:/mnt/quotaext3/ /mnt/nfs/quotaext3 nfs4 rw,relatime,vers=4,rsize=524288,wsize=524288,namlen=255,hard,proto=tcp6,port=0,timeo=600,retrans=2,sec=sys,clientaddr=::1,minorversion=0,addr=::1 0 0

$ quota -v -f /mnt/nfs/quotaext3/
quota: error while getting quota from ::1:/mnt/quotaext3/ for petr (id 500): Connection refused

I identified three problems till now:

(1) RPC service does not listen on IPv6 (see the rpcinfo output)
(2) Linux does not escape IPv6 with brackets in /proc/mounts
(3) rpc_rquota_get() in rquota_client.c:137 searches for first colon:
if ((pathname = strchr(fsname_tmp, ':')) == (char *)0 || *(pathname + 1) == '(') {
free(fsname_tmp);
return -ENOENT;
}

Discussion

  • Jan Kara

    Jan Kara - 2011-02-16

    I did some research on this. So (2) is not problem - kernel needs to be fixed but that's reasonably simple as I had a look at that code. (3) is trivial to fix once (2) is done. In fact I already fixed (3) in rquota_client.c. But (1) does not seem to be completely trivial. TIRPC library has to be used instead of GLIBC RPC support. But I have to yet find out how to properly utilize this library because some initial experiments are not successful ;)

     
  • Anders Blomdell

    Anders Blomdell - 2016-11-04

    Strawman implementation (blatantly stolen from NFS) using TIRPC, build using:

    ./autogen.sh
    CFLAGS='-I/usr/include/tirpc -DHAVE_LIBTIRPC -DIPV6_SUPPORTED' LDFLAGS='-ltirpc' ./configure
    make

    would appreciate some feedback on what cleanup is required.

     
  • Jan Kara

    Jan Kara - 2017-09-05

    Anders, thanks for the patch! Finally I've found enough time to look into this. Since I didn't know tirpc details at all, I wasn't really able to sensibly comment on what to clean up. After looking into details (and your patch greatly helped in looking where I need to search), I was able to drop most of NFS stuff and the patches are very simple. The result is pushed out to quota-tools repository.

     
  • Jan Kara

    Jan Kara - 2017-09-05
    • status: open --> closed-fixed
    • assigned_to: Jan Kara
    • Group: -->
     
    • Anonymous

      Anonymous - 2017-09-05

      Thank you so much!

       
  • Anders Blomdell

    Anders Blomdell - 2017-09-05

    Many thanks!

     

Anonymous
Anonymous

Add attachments
Cancel