[Samba] weird interaction with NFS quota-enabled mount

Andreas Hasenack andreas.hasenack at canonical.com
Thu May 22 15:11:46 UTC 2025


Hi,

this is a somewhat unique setup (I think), where an NFS share is
mounted on a samba server, and re-exported by samba. The NFS server
has quotas enabled on the exported filesystem.

NFS SERVER -> NFS CLIENT/SMB SERVER -> CIFS CLIENT

The moment I start quotarpc on the NFS server, I see different
behaviors on smb clients, depending if the SMB SERVER is ubuntu or
debian. Essentially, if the SMB SERVER is Ubuntu, the CIFS CLIENT will
show the share as being 100% full, always. If the SMB SERVER is
debian, the share will not be 100% full, and show a correct value of
disk utilization.

This stack involves many pieces of software: nfs stack, tinyrpc,
rpcsvc-proto, samba itself, kernel (due to mount via cifs), quotarpc
daemon, etc.

I managed to get a quota debug level 10 output from samba in both
cases, and looks like the getquota_rslt struct it filled in
incorrectly. This struct is defined in <rquota.h>, from the
rpcsvc-proto package. It didn't change between the working and failing
case, as far as I could tell.

Working case:
  sys_get_nfs_quotas: getquota_rslt:
  status : '1'
  bsize : '1024'
  active : 'yes'
  bhardlimit : '5000'
  bsoftlimit : '4000'
  curblocks : '1024'
  fhardlimit : '8'
  fsoftlimit : '0'
  curfiles : '0'
  btimeleft : '1'
  ftimeleft : '3918673920'

Failing case  sys_get_nfs_quotas: getquota_rslt:
  status : '1'
  bsize : '1024'
  active : 'yes'
  bhardlimit : '5000'
  bsoftlimit : '4000'
  curblocks : '1024'
  fhardlimit : '125312609'
  fsoftlimit : '30077'
  curfiles : '131072'
  btimeleft : '0'
  ftimeleft : '8':

I know I'm not giving all details yet. This would be a huge email if I
did. For whoever is interested, this is the bug we got about it:
https://bugs.launchpad.net/ubuntu/+source/samba/+bug/2077725

What I'm looking for here is essentially:
- has anybody else seen this?
- what could the most likely culprit be? Any pointers to where I
should focus next?
- is re-exporting a mounted NFS share via samba ill-advised?

The version of samba where we started seeing this is 4.19.5, and I
tested 4.20.4 and 4.21.4. Haven't tested 4.22 yet. Also keep in mind
that 4.19.5, for example, also meant a whole different set of versions
fot the rest of the stack (nfs, cifs, kernel, etc). It is a different
ubuntu release entirely.

There is still a lot to narrow down, in terms of versions. I'm just
looking for some pointers here, and best wishes :)



More information about the samba mailing list