CIFS client reports 100% disk usage when rpc-quotad is started

Bug #2077725 reported by Stefan Staeglich
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
samba (Debian)
Fix Committed
Unknown
samba (Ubuntu)
Triaged
Low
Unassigned
Noble
Triaged
Low
Unassigned

Bug Description

We export NFS shares to a Samba server to enable access from Windows clients. Quotas are partially active on these shares.

With Ubuntu 24.04, the free space under Windows is displayed as 0 bytes if the rpc-quotad is running on the NFS server. The problem does not occur under Ubuntu 22.04 with the same configuration.

This is the global section of our samba config:

[global]
        client signing = if_required
        disable netbios = Yes
        kerberos method = secrets and keytab
        realm = EXAMPLE.DOMAIN
        security = ADS
        winbind enum groups = Yes
        winbind enum users = Yes
        winbind expand groups = 2
        winbind refresh tickets = Yes
        winbind use default domain = Yes
        workgroup = EXAMPLE
        rpc_daemon:spoolssd = fork
        rpc_server:spoolss = external
        spoolss: architecture = Windows x64
        idmap config example:unix_nss_info = yes
        idmap config example:unix_primary_group = yes
        idmap config example:range = 1010-999999
        idmap config example:schema_mode = rfc2307
        idmap config example:backend = ad
        idmap config * : range = 1000-1009
        full_audit:priority = NOTICE
        full_audit:facility = local7
        full_audit:prefix = IP=%I|USER=%u|MACHINE=%m|VOLUME=%S
        full_audit:success = pwrite write renameat
        full_audit:failure = none
        idmap config * : backend = tdb

ProblemType: Bug
DistroRelease: Ubuntu 24.04
Package: samba 2:4.19.5+dfsg-4ubuntu9
ProcVersionSignature: Ubuntu 6.8.0-41.41-generic 6.8.12
Uname: Linux 6.8.0-41-generic x86_64
ApportVersion: 2.28.1-0ubuntu3.1
Architecture: amd64
CasperMD5CheckResult: unknown
Date: Fri Aug 23 12:50:09 2024
ProcEnviron:
 LANG=en_US.UTF-8
 LANGUAGE=en
 PATH=(custom, no user)
 SHELL=/bin/bash
 TERM=xterm-256color
SambaServerRegression: Yes
SmbConfIncluded: No
SourcePackage: samba
TestparmExitCode: 0
UbuntuFailedConnect: Yes
UpgradeStatus: Upgraded to noble on 2024-08-22 (1 days ago)

Revision history for this message
Stefan Staeglich (staeglis) wrote :
Revision history for this message
Stefan Staeglich (staeglis) wrote :

The output of the command quota looks as normal. We tested the Ubuntu 22.04 kernel already.

description: updated
Revision history for this message
Athos Ribeiro (athos) wrote :

Hi Stefan,

Thanks for reporting this bug and helping us making Ubuntu better.

Would you mind providing us more detailed steps to reproduce this issue from a fresh Ubuntu installation?

We usually try to reproduce these from VMs. Since we will need to also spawn Windows machines to test this one, it would be nice to have a detailed step-by-step guide to be able to reproduce this. Please, make sure to include the expected behavior you would want the system to show and the actual behavior there.

For now, I am marking this bug as incomplete. Once you provide the requested information, please, move this bug status back to new.

Changed in samba (Ubuntu):
status: New → Incomplete
Revision history for this message
Stefan Staeglich (staeglis) wrote :

Hi Athos,

I hope we can provide the requested information soon. So far I can confirm that the source of the problem is only samba. The problem will disappear when we switch to sernet samba+ 4.20 packages.

Revision history for this message
Stefan Staeglich (staeglis) wrote :

I'm also able to reproduce the issue on Ubuntu 22.04 using the sernet samba+ 4.19 packages. So this seems to be an upstream issue.

Unfortunately you need at least two VMs for reproducing the issue: NFS server and samba server. I can't reproduce it exporting just a local ext4, also when mounted via NFS on the same machine.

summary: - Windows reports 100% disk usage when rpc-quotad is started
+ CIFS client reports 100% disk usage when rpc-quotad is started
Revision history for this message
Mitchell Dzurick (mitchdz) wrote :

Stefan,

If this seems to be an upstream issue, would you mind making a bug report upstream? It'd be nice to get this fix for everyone.

Revision history for this message
Stefan Staeglich (staeglis) wrote :

I've tried this. This is the answer:

> thanks for the report but as that ubuntu bug report already points out,
> this isn't a bug any more in all the maintained upstream samba versions >
> (4.20.x and 4.21.x). 4.19 is in security fix only state already. If you
> or ubuntu can bisect samba to find the relevant change, ubuntu might fix
> this in their 4.19 packages.

Would it be possible to offer 4.20.x instead? It would not be the first time that samba gets a minor update within an LTS.

Changed in samba (Ubuntu):
status: Incomplete → New
Revision history for this message
Athos Ribeiro (athos) wrote :

Hi Stefan,

If the reason would be to fix a single bug, that would be unlikely. First we need a reproducer so we can identify the bug and look for a fix. Of course that could be considered if we identify the bug and a fix is indeed not trivial (e.g., it is fixed not by a single change, but by several upstream changes).

Therefore, the first step here would be to have a clear, well described, preferably short reproducer for this bug. Do you think it is possible to provide one?

Changed in samba (Ubuntu):
status: New → Incomplete
Revision history for this message
Stefan Staeglich (staeglis) wrote (last edit ):
Download full text (4.6 KiB)

Steps to reproduce:

Requirements: Working Active Directory setup

Install two VMs with the following basic setup with name nfssrv / smbsrv

1. Install minimal server with OpenSSH server via ISO

2. Install packages
apt-get install --yes cifs-utils mount.cifskrb5-user libnss-winbind libpam-winbind samba smbclient winbind vim quota

3. Create /etc/samba/smb.conf

[global]
workgroup = EXAMPLE
client signing = yes
client use spnego = yes
kerberos method = secrets and keytab
realm = EXAMPLE.DOMAIN
security = ads
disable netbios = yes
idmap config * : backend = tdb
idmap config * : range = 1000-1009
idmap config EXAMPLE:backend = ad
idmap config EXAMPLE:schema_mode = rfc2307
idmap config EXAMPLE:range = 1010-999999
idmap config EXAMPLE:unix_primary_group = yes
idmap config EXAMPLE:unix_nss_info = yes
winbind use default domain = true
winbind refresh tickets = yes
winbind enum users = yes
winbind enum groups = yes
winbind expand groups = 2

4. Join system

kinit $joinuser
net ads join -k
kdestroy

4. Check /etc/nsswitch.conf

# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.

passwd: files systemd winbind
group: files systemd winbind
shadow: files systemd
gshadow: files systemd

hosts: files dns
networks: files

protocols: db files
services: db files
ethers: db files
rpc: db files

netgroup: nis

5. Restart services

systemctl restart winbind smbd

6. Enable pam-winbind and pam-mkhomedir via pam-auth-update

Input 1,2,3,4

Install nfs-server on VM nfssrv

1. Install packages

apt-get --yes install nfs-kernel-server

2. Add second disk and format

cfdisk
mkfs.ext4 -O quota /dev/sdb1

3. Add to /etc/fstab

/dev/sdb1 /export/data ext4 usrquota,grpquota 0 2

4. Mount disk

mkdir -p /export/data
systemctl daemon-reload
mount -a

5. Update /etc/exports

/export/data smbsrv(rw,sync,no_subtree_check,sec=sys)

6. Enable config

exportfs -ra
systemctl enable quotarpc
systemctl start quotarpc

7. Set quota for domain test user testdom via edquota

Disk quotas for user testdom (uid $id):
  Filesystem blocks soft hard inodes soft hard
  /dev/sdb1 0 2000 4000 0 0 0

8. Check quota for testdom

Verify quota via writing data to sbd1 as user testdom

epquota -u /export/data/ -n
*** Report for user quotas on device /dev/sdb1
Block grace time: 7days; Inode grace time: 7days
                        Block limits File limits
User used soft hard grace used soft hard grace
----------------------------------------------------------------------
#0 -- 20 0 0 2 0 0
#$id -- 4 2000 4000 1 0 0

Install samba-server on VM smbsrv

1. Install packages

apt-get --yes install nfs-client

2. Add to /etc/fstab

nfssrv:/export/data /data nfs defaults 0 2

3. Mount disk

mkdir -p /data
syst...

Read more...

Changed in samba (Ubuntu):
status: Incomplete → New
Athos Ribeiro (athos)
Changed in samba (Ubuntu):
status: New → Triaged
Athos Ribeiro (athos)
Changed in samba (Ubuntu Noble):
status: New → Triaged
Revision history for this message
Stefan Staeglich (staeglis) wrote :

Hi, have you been able to reproduce the issue?

Bryce Harrington (bryce)
tags: added: server-triage-discuss
Revision history for this message
Bryce Harrington (bryce) wrote :

Hi Stefan, thank you for providing the steps to reproduce, and taking the time to write them up to this level of detail. This will be super helpful in moving forward with the bug.

The next step, as Athos mentioned in comment #8 is to isolate the upstream fix needed. Hopefully now that you've outlined a test case, there's a path to doing that. (Possibly this will require a git bisection search, which can be very effective though time consuming).

I've added this to my team's list of items to discuss at our bug review meeting next Wednesday. I should set expectations though, with the caveat that our team's schedule is pretty full through at least to the end of October.

Revision history for this message
Bryce Harrington (bryce) wrote :

One question we have that might help narrow things down - could you test this on Ubuntu oracular? It has samba version 2:4.20.4+dfsg-1ubuntu1, which would verify whether the newer version has the necessary fix or not.

tags: removed: server-triage-discuss
Changed in samba (Ubuntu):
status: Triaged → Incomplete
Revision history for this message
Stefan Staeglich (staeglis) wrote :

I have updated smbsrv to oracular on the test computer. Contrary to expectations, this does not seem to solve the problem. So the bug seems to be only in the Ubuntu packages and not in samba+.

Changed in samba (Ubuntu):
status: Incomplete → New
Revision history for this message
Stefan Staeglich (staeglis) wrote :

I have just verified that samba+ does not have the problem. Have additional patches been introduced with 24.04 that change the upstream code? Or maybe existing patches are problematic with newer samba versions?

Revision history for this message
Mitchell Dzurick (mitchdz) wrote :

Adding server-triage-discuss to see if someone would be able to dedicate some time to this, it seems it might take a little bit of setup to narrow down where the bug and potential solution is.

tags: added: server-triage-discuss
Changed in samba (Ubuntu Noble):
assignee: nobody → Andreas Hasenack (ahasenack)
Changed in samba (Ubuntu):
assignee: nobody → Andreas Hasenack (ahasenack)
tags: removed: server-triage-discuss
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Which 4.20.X version of sernet packages did you try that do not have the bug? In Oracular, we have 4.20.4.

Regarding patches, this is what we have in oracular's samba 4.20.4:

  https://git.launchpad.net/ubuntu/+source/samba/tree/debian/patches?h=ubuntu/oracular-devel

I'm setting up vms to try to reproduce this, in the meantime.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Reproduced without having to integrate with AD.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

And in jammy I get the available quota in the df output:

//localhost/data 2.0M 4.0K 2.0M 1% /mnt

Noble:
//localhost/data 4.0K 4.0K 0 100% /mnt/cifs

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

samba+ are a commercial offering from sernet: https://samba.plus/products/samba

They might have fixed this outside of the upstream source tree, I'm not sure. I'm going over the upstream commit logs, but so far didn't see any obvious commit about this.

The latest version in the 4.20 series is 4.20.5: https://www.samba.org/samba/history/samba-4.20.5.html
Nothing about quotas there.

Then we have the 4.21 series, which is at 4.21.1 at the moment: https://www.samba.org/samba/history/samba-4.21.1.html

Debian has 4.21.1, I'll give it a try in a VM.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Debian's 4.21.1 seems to have worked:

//localhost/data 2.0M 4.0K 2.0M 1% /mnt

Could still be something else in the system, like nfs itself, but worth checking if a 4.21.1 build in ubuntu noble also "fixes" it.

Revision history for this message
Stefan Staeglich (staeglis) wrote :

Thank you for your efforts. I have created a backport of Samba 4.21.1:

https://launchpad.net/~staeglis/+archive/ubuntu/samba-backport

Unfortunately in my test environment this did not fix the problem

Revision history for this message
Stefan Staeglich (staeglis) wrote :

Also no fix with NFS backport:

https://launchpad.net/~staeglis/+archive/ubuntu/nfs-backport

@Andreas Do you have any other idea? Can you please test these backports in your test environment too?

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Hm, next in the list of differences would be the kernel...

Revision history for this message
Stefan Staeglich (staeglis) wrote :

The fact that 24.10 is also affected speaks against the kernel. I also remember that we tested this with the 22.04 kernel under 24.04, unfortunately without success

Revision history for this message
Stefan Staeglich (staeglis) wrote :

@Andreas Do you have tested with Debian Bookworm or Debian Trixie?

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

> @Andreas Do you have tested with Debian Bookworm or Debian Trixie?

It was trixie (sid). Can you easily set that up in your environment?

Bryce Harrington (bryce)
tags: added: server-todo
Revision history for this message
Stefan Staeglich (staeglis) wrote :

I tested it on trixie and can confirm that it is not affected.

Revision history for this message
Stefan Staeglich (staeglis) wrote :

Mainline kernel 6.11 doesn't fix it on 24.04

Revision history for this message
Bryce Harrington (bryce) wrote :

I took a quick look through the Ubuntu delta, however nothing sticks out to me.

Andreas linked to the list of patches included in our package (i.e. https://git.launchpad.net/ubuntu/+source/samba/tree/debian/patches?h=ubuntu/oracular-devel), however it appears the only patch change unique to Ubuntu is the *removal* of tilde-in-version.diff, which sounds unlikely to cause this problem.

Here is the remaining list of Ubuntu delta that is present both in the noble and oracular versions:

        - debian/control: Ubuntu i386 binary compatibility:
          + enable the liburing vfs module, except on i386 where liburing is
            not available
        - d/t/control, d/t/util,d/t/samba-ad-dc-provisioning-internal-dns:
          samba AD DC provisioning and domain join tests with internal DNS
          (LP #1977746, LP #2011745)
        - d/control: adjust breaks/replaces for file move that Debian did in
          4.16.6+dfsg-5, and Ubuntu only did in 4.17.7+dfsg-1ubuntu1, to avoid
          file conflict in a dist-upgrade from earlier Ubuntu releases, like
          Kinetic (LP #2024663)
        - Fix t64 package name in 'Enhances' attribute.
        - debian/tests: launch container with security.nesting=true
          Otherwise, systemd-resolved in the member-server container will
          fail to start, and cause the test to fail. (LP #2046486)
        - d/control: make samba-vfs-modules-extra a transitional package.
          The glusterfs vfs module (the only vfs module shipped in it
          previously) is now in bin:samba-vfs-glusterfs
        - d/control: have the (now transitional) samba-vfs-modules package
          depend on samba-vfs-ceph, so that upgrades retain the ceph vfs
          module

The first sounds i386-specific. The second and fifth are purely testsuite changes. Items 3 and 4 are just package dependency tweaks:

3: https://git.launchpad.net/ubuntu/+source/samba/commit/?h=ubuntu/oracular-devel&id=4bc3f688823ad85459306053ce8338e09430b996
4: https://git.launchpad.net/ubuntu/+source/samba/commit/?h=ubuntu/oracular-devel&id=2a6a7784d046ad66656ca78d920fb845a2f28034

And the last two are transitional changes to a module that sounds irrelevant to this problem.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

> Also no fix with NFS backport

NFS has a ton of dependencies, maybe libtirpc is one to investigate further.

Noble and trixie:

libtirpc | 1.3.4+ds-1.1build1 | noble | source
libtirpc | 1.3.4+ds-1.3 | testing | source

But 1.2 and 1.3 in debian are just no-change rebuilds

Revision history for this message
Stefan Staeglich (staeglis) wrote :

How can we make progress here? We have just run tests again: Ubuntu 24.10 and the upcoming 25.04 are both affected. So the problem will not automatically go away with the next LTS release.

So some change to Upstream has introduced the problem into Ubuntu 24.04 and later. However, Debian 13 is not affected.

So could you look again specifically for changes from 22.04 in Ubuntu that did not come before Debian or were adopted? We are willing to do further tests.

Revision history for this message
Stefan Staeglich (staeglis) wrote :

I tested it with 22.10 and 23.04. After the upgrade to 23.04 the problem occurs.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

> upcoming 25.04 are both affected.

You have tested it with the upcoming ubuntu plucky release?

Revision history for this message
Stefan Staeglich (staeglis) wrote :

> You have tested it with the upcoming ubuntu plucky release?

Yes

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

I don't know how to make further progress on this bug. We checked many components of this stack, but I don't know which one is the culprit. We have:
- nfs and its many daemons, including rpc
- kernel
- samba

The fact that this happens when re-exporting an already shared filesystem (nfs -> samba -> client) makes this tricky.

Have you tried different versions of NFS in that mount? I don't recall.

Revision history for this message
Stefan Staeglich (staeglis) wrote :

Yes both NFSv3 and NFSv4 are affected

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Even NFSv4? Curious, I thought it wouldn't use rpc-quotad

Revision history for this message
Stefan Staeglich (staeglis) wrote :

Yes, I have just verified it again

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

I tried this setup again, using NFS 4.2, security=sys, and enabled quota debugging on the samba server (log level = quota:3). Got something interesting:

With quotarpc enabled on the nfs server (reproducing the bug: df shows 100% usage)
==> /var/log/samba/log.q-cifs <==
[2025/05/20 17:39:27.956109, 3] source3/lib/sysquotas_nfs.c:139(sys_get_nfs_quota)
  sys_get_nfs_quota: got unsupported quota type '1', only supported type is '2' (SMB_USER_QUOTA_TYPE)
[2025/05/20 17:39:27.956246, 3] source3/lib/sysquotas.c:519(sys_get_quota)
  sys_get_nfs4_quota() failed for mntpath[/mnt/from-nfs] bdev[10.10.17.230:/export/data] qtype[1] id[-1]: Function not implemented.

With quotarpc disabled:
[2025/05/20 17:43:22.592787, 3] source3/lib/sysquotas_nfs.c:139(sys_get_nfs_quota)
  sys_get_nfs_quota: got unsupported quota type '1', only supported type is '2' (SMB_USER_QUOTA_TYPE)
[2025/05/20 17:43:22.592852, 3] source3/lib/sysquotas.c:519(sys_get_quota)
  sys_get_nfs4_quota() failed for mntpath[/mnt/from-nfs] bdev[10.10.17.230:/export/data] qtype[1] id[-1]: Function not implemented.
[2025/05/20 17:43:22.594259, 3] source3/lib/sysquotas.c:519(sys_get_quota)
  sys_get_nfs4_quota() failed for mntpath[/mnt/from-nfs] bdev[10.10.17.230:/export/data] qtype[2] id[1000]: Success.
[2025/05/20 17:43:22.594433, 3] source3/lib/sysquotas_nfs.c:139(sys_get_nfs_quota)
  sys_get_nfs_quota: got unsupported quota type '3', only supported type is '2' (SMB_USER_QUOTA_TYPE)
[2025/05/20 17:43:22.594446, 3] source3/lib/sysquotas.c:519(sys_get_quota)
  sys_get_nfs4_quota() failed for mntpath[/mnt/from-nfs] bdev[10.10.17.230:/export/data] qtype[3] id[-1]: Function not implemented.
[2025/05/20 17:43:22.594534, 3] source3/lib/sysquotas_nfs.c:139(sys_get_nfs_quota)
  sys_get_nfs_quota: got unsupported quota type '4', only supported type is '2' (SMB_USER_QUOTA_TYPE)
[2025/05/20 17:43:22.594545, 3] source3/lib/sysquotas.c:519(sys_get_quota)
  sys_get_nfs4_quota() failed for mntpath[/mnt/from-nfs] bdev[10.10.17.230:/export/data] qtype[4] id[1000]: Function not implemented.

Could this be related to native ext4 quota, versus "old-style" quotas? I'm unsure, but that distinction came to mind while I was setting this up.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Those numbers 3 and 4 map to:

root@q-nfs:~# tune2fs -l /dev/sdb1 | grep -i quota
Filesystem features: has_journal ext_attr resize_inode dir_index orphan_file filetype needs_recovery extent 64bit flex_bg metadata_csum_seed sparse_super large_file huge_file dir_nlink extra_isize quota metadata_csum orphan_present
User quota inode: 3
Group quota inode: 4

hmm

Revision history for this message
Andreas Hasenack (ahasenack) wrote :
Download full text (6.9 KiB)

To save this here, with debug 10, and quotarpc STOPPED, I get:
==> /var/log/samba/log.q-cifs <==
[2025/05/20 17:57:19.417440, 10, pid=5360, effective(1000, 1000), real(1000, 0), class=quota] source3/lib/sysquotas.c:513(sys_get_quota)
  sys_get_quota() uid(1000, 1000), fs(nfs4)
[2025/05/20 17:57:19.417586, 10, pid=5360, effective(1000, 1000), real(1000, 0), class=quota] source3/lib/sysquotas_nfs.c:131(sys_get_nfs_quota)
  sys_get_nfs_quota: path[/mnt/from-nfs] bdev[10.10.17.230:/export/data] qtype[1]
[2025/05/20 17:57:19.417608, 3, pid=5360, effective(1000, 1000), real(1000, 0), class=quota] source3/lib/sysquotas_nfs.c:139(sys_get_nfs_quota)
  sys_get_nfs_quota: got unsupported quota type '1', only supported type is '2' (SMB_USER_QUOTA_TYPE)
[2025/05/20 17:57:19.417644, 3, pid=5360, effective(1000, 1000), real(1000, 0), class=quota] source3/lib/sysquotas.c:519(sys_get_quota)
  sys_get_nfs4_quota() failed for mntpath[/mnt/from-nfs] bdev[10.10.17.230:/export/data] qtype[1] id[-1]: Function not implemented.
[2025/05/20 17:57:19.417871, 10, pid=5360, effective(1000, 1000), real(1000, 0), class=quota] source3/lib/sysquotas.c:513(sys_get_quota)
  sys_get_quota() uid(1000, 1000), fs(nfs4)
[2025/05/20 17:57:19.417892, 10, pid=5360, effective(1000, 1000), real(1000, 0), class=quota] source3/lib/sysquotas_nfs.c:131(sys_get_nfs_quota)
  sys_get_nfs_quota: path[/mnt/from-nfs] bdev[10.10.17.230:/export/data] qtype[2]
[2025/05/20 17:57:19.417906, 10, pid=5360, effective(1000, 1000), real(1000, 0), class=quota] source3/lib/sysquotas_nfs.c:165(sys_get_nfs_quota)
  sys_get_nfs_quotas: Asking for quota of path '10.10.17.230' on host 'export/data', rpcprog '100011', rpcvers '1', network 'udp'
[2025/05/20 17:57:19.419835, 10, pid=5360, effective(1000, 1000), real(1000, 0), class=quota] source3/lib/sysquotas_nfs.c:285(sys_get_nfs_quota)
  sys_get_nfs_quotas: finished
[2025/05/20 17:57:19.420174, 3, pid=5360, effective(1000, 1000), real(1000, 0), class=quota] source3/lib/sysquotas.c:519(sys_get_quota)
  sys_get_nfs4_quota() failed for mntpath[/mnt/from-nfs] bdev[10.10.17.230:/export/data] qtype[2] id[1000]: Success.
[2025/05/20 17:57:19.420431, 10, pid=5360, effective(1000, 1000), real(1000, 0), class=quota] source3/lib/sysquotas.c:513(sys_get_quota)
  sys_get_quota() uid(1000, 1000), fs(nfs4)
[2025/05/20 17:57:19.420451, 10, pid=5360, effective(1000, 1000), real(1000, 0), class=quota] source3/lib/sysquotas_nfs.c:131(sys_get_nfs_quota)
  sys_get_nfs_quota: path[/mnt/from-nfs] bdev[10.10.17.230:/export/data] qtype[3]
[2025/05/20 17:57:19.420460, 3, pid=5360, effective(1000, 1000), real(1000, 0), class=quota] source3/lib/sysquotas_nfs.c:139(sys_get_nfs_quota)
  sys_get_nfs_quota: got unsupported quota type '3', only supported type is '2' (SMB_USER_QUOTA_TYPE)
[2025/05/20 17:57:19.420469, 3, pid=5360, effective(1000, 1000), real(1000, 0), class=quota] source3/lib/sysquotas.c:519(sys_get_quota)
  sys_get_nfs4_quota() failed for mntpath[/mnt/from-nfs] bdev[10.10.17.230:/export/data] qtype[3] id[-1]: Function not implemented.
[2025/05/20 17:57:19.420575, 10, pid=5360, effective(1000, 1000), real(1000, 0), class=quota] source3/lib/sysquotas.c:513(sys_get_quota)
  sys...

Read more...

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

I deployed alongside this nfs server a debian sid nfs client and samba client. Mounting the share localhost, worked.

But then I mounted the samba share from the other ubuntu server, which is showing the problem, and then debian sid also showed 100% usage:

10.10.17.230:/export/data 9.8G 3.2M 9.3G 1% /mnt/from-nfs
//10.10.18.190/data 1.0M 1.0M 0 100% /mnt/from-cifs

10.10.18.190 is the q-cifs ubuntu questing system.

Trying the reverse now:
- have debian sid mount nfs, and re-export it via cifs
- have the UBUTNU system mount that cifs fs

Then the ubuntu system did not show the bug:
10.10.17.230:/export/data 9.8G 3.2M 9.3G 1% /mnt/from-nfs
//10.10.18.214/data 4.0M 1.0M 3.0M 26% /mnt/from-cifs

10.10.18.214 is debian sid.

This means the problem is coming from either the samba server, or the nfs client. I think.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Here is debug 10 from debian-sid, mounting localhost, with quotarpc running on the nfs server, and the bug is not present:

==> /var/log/samba/log.sid-cifs <==
[2025/05/20 18:49:51.789744, 10, pid=4422, effective(1000, 1000), real(1000, 0), class=quota] source3/lib/sysquotas.c:513(sys_get_quota)
  sys_get_quota() uid(1000, 1000), fs(nfs4)
[2025/05/20 18:49:51.790539, 10, pid=4422, effective(1000, 1000), real(1000, 0), class=quota] source3/lib/sysquotas_nfs.c:131(sys_get_nfs_quota)
  sys_get_nfs_quota: path[/mnt/from-nfs] bdev[10.10.17.230:/export/data] qtype[1]
[2025/05/20 18:49:51.790599, 3, pid=4422, effective(1000, 1000), real(1000, 0), class=quota] source3/lib/sysquotas_nfs.c:139(sys_get_nfs_quota)
  sys_get_nfs_quota: got unsupported quota type '1', only supported type is '2' (SMB_USER_QUOTA_TYPE)
[2025/05/20 18:49:51.790625, 3, pid=4422, effective(1000, 1000), real(1000, 0), class=quota] source3/lib/sysquotas.c:519(sys_get_quota)
  sys_get_nfs4_quota() failed for mntpath[/mnt/from-nfs] bdev[10.10.17.230:/export/data] qtype[1] id[-1]: Function not implemented.
[2025/05/20 18:49:51.791140, 10, pid=4422, effective(1000, 1000), real(1000, 0), class=quota] source3/lib/sysquotas.c:513(sys_get_quota)
  sys_get_quota() uid(1000, 1000), fs(nfs4)
[2025/05/20 18:49:51.791204, 10, pid=4422, effective(1000, 1000), real(1000, 0), class=quota] source3/lib/sysquotas_nfs.c:131(sys_get_nfs_quota)
  sys_get_nfs_quota: path[/mnt/from-nfs] bdev[10.10.17.230:/export/data] qtype[2]
[2025/05/20 18:49:51.791230, 10, pid=4422, effective(1000, 1000), real(1000, 0), class=quota] source3/lib/sysquotas_nfs.c:165(sys_get_nfs_quota)
  sys_get_nfs_quotas: Asking for quota of path '10.10.17.230' on host 'export/data', rpcprog '100011', rpcvers '1', network 'udp'
[2025/05/20 18:49:51.797543, 10, pid=4422, effective(1000, 1000), real(1000, 0), class=quota] source3/lib/sysquotas_nfs.c:209(sys_get_nfs_quota)
  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'
[2025/05/20 18:49:51.798711, 10, pid=4422, effective(1000, 1000), real(1000, 0), class=quota] source3/lib/sysquotas_nfs.c:242(sys_get_nfs_quota)
  sys_get_nfs_quotas: Good quota data
[2025/05/20 18:49:51.798793, 10, pid=4422, effective(1000, 1000), real(1000, 0), class=quota] source3/lib/sysquotas_nfs.c:285(sys_get_nfs_quota)
  sys_get_nfs_quotas: finished
[2025/05/20 18:49:51.798812, 10, pid=4422, effective(1000, 1000), real(1000, 0), class=quota] source3/lib/sysquotas.c:522(sys_get_quota)
  sys_get_nfs4_quota() called for mntpath[/mnt/from-nfs] bdev[10.10.17.230:/export/data] qtype[2] id[1000].

df -h:
10.10.17.230:/export/data 9.8G 3.2M 9.3G 1% /mnt/from-nfs
//sid-cifs/data 4.0M 1.0M 3.0M 26% /mnt/from-cifs

Revision history for this message
Andreas Hasenack (ahasenack) wrote (last edit ):

Hmn, there is something going on with the getquota_rslt struct:

Debian (worked):
  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'

Ubuntu (failed):
  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'

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

I emailed samba upstream, via the mailing list[1], and the consensus seems to be "don't do this": re-exporting a network mounted filesystem/share is asking for trouble, specially when using different protocols. File locking by itself will be a mess.

A better solution would be to export the storage via smb from the source, multiple times: storage -> NFS, storage -> SMB. Instead of storage -> NFS -> SMB.

Granted, we still don't know why it works when debian is the nfs client and the smb server. If someone can point us at the exact cause, then perhaps a fix could be envisioned. But for now, this bug has taken many hours of troubleshooting already, and I fear there isn't much more we can do.

1. https://lists.samba.org/archive/samba/2025-May/251555.html

tags: removed: server-todo
Changed in samba (Ubuntu Noble):
assignee: Andreas Hasenack (ahasenack) → nobody
Changed in samba (Ubuntu):
status: New → Triaged
Changed in samba (Ubuntu Noble):
importance: Undecided → Low
Changed in samba (Ubuntu):
importance: Undecided → Low
assignee: Andreas Hasenack (ahasenack) → nobody
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

There is a new samba version in questing, 4.22.3, perhaps it could be tested to see if there is any change. But nothing in the release notes jumps out as being a change that addressed the scenario described in this bug.

Changed in samba (Debian):
status: Unknown → New
Revision history for this message
Stefan Staeglich (staeglis) wrote :

The Debian bug report looks very interesting. This means that the bug was also present in Debian. However, Debian 13 is not affected, but Ubuntu 25.04 was already affected as of April.

This means that there is a defined time window in which the bug should have been fixed.

I am happy to run a few more tests with Ubuntu 25.10 and a new Samba backport from Debian 13 for Ubuntu 24.04. However, this will take some time, as I am currently on vacation.

Changed in samba (Debian):
status: New → Fix Committed
Revision history for this message
Stefan Staeglich (staeglis) wrote :

25.10 is also affected. Debian 13 not but there is an other bug with the printer backend.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.