Andreas Hasenack
2025-May-22 15:11 UTC
[Samba] weird interaction with NFS quota-enabled mount
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 :)
Rowland Penny
2025-May-24 14:06 UTC
[Samba] weird interaction with NFS quota-enabled mount
On Thu, 22 May 2025 12:11:46 -0300 Andreas Hasenack via samba <samba at lists.samba.org> wrote:> 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. >The big problem here, in my opinion, is that it is generally accepted that sharing an NFS mount with Samba is a very bad idea, all sorts of things go wrong. Rowland
Am 22.05.25 um 17:11 schrieb Andreas Hasenack via samba:> NFS SERVER -> NFS CLIENT/SMB SERVER -> CIFS CLIENTOne big problem will be file locking. Both NFS and SMB uses different file locking. So if someone opend a file via smb and a differnet user will open the file for writing via NFS you are in big trouble. And the next thing is filesystem permission. There a some more point, but I think these two point are the most important to NOT do it. -------------- next part -------------- A non-text attachment was scrubbed... Name: OpenPGP_signature.asc Type: application/pgp-signature Size: 236 bytes Desc: OpenPGP digital signature URL: <http://lists.samba.org/pipermail/samba/attachments/20250526/7ec68184/OpenPGP_signature.sig>