"File system loop detected" with btrfs over NFS

Bug #1918599 reported by Ulli Horlacher
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
btrfs-progs (Ubuntu)
New
Undecided
Unassigned
nfs-utils (Ubuntu)
New
Undecided
Unassigned

Bug Description

tsmsrvi and tsmsrvj both run Ubuntu 20.04 with all updates applied.
When I try to access a btrfs filesystem via nfs, I get the error:

root@tsmsrvi:~# mount tsmsrvj:/data/fex /nfs/tsmsrvj/fex

root@tsmsrvi:~# find /nfs/tsmsrvj/fex
/nfs/tsmsrvj/fex
find: File system loop detected; '/nfs/tsmsrvj/fex/spool' is part of the same file system loop as '/nfs/tsmsrvj/fex'.

root@tsmsrvi:~# du -s /nfs/tsmsrvj/fex
du: WARNING: Circular directory structure.
This almost certainly means that you have a corrupted file system.
NOTIFY YOUR SYSTEM MANAGER.
The following directory is part of the cycle:
  /nfs/tsmsrvj/fex/spool

0 /nfs/tsmsrvj/fex

root@tsmsrvi:~# ls -l /nfs/tsmsrvj/fex/
total 0
drwxr-xr-x 1 fex fex 261964 Mar 7 14:53 spool

On tsmsrvj I have in /etc/exports:

/data/fex localhost(rw,async,no_subtree_check,no_root_squash)
/data/fex tsmsrvi(rw,async,no_subtree_check,no_root_squash)

/data/fex is a btrfs filesystem with subvolumes:

root@tsmsrvj:~# mount | grep /data
/dev/sdb1 on /data type btrfs (rw,relatime,space_cache,user_subvol_rm_allowed,subvolid=5,subvol=/)

root@tsmsrvj:~# btrfs subvolume list /data
ID 257 gen 35 top level 5 path fex
ID 270 gen 36 top level 257 path fex/spool
ID 271 gen 21 top level 270 path fex/spool/.snapshot/2021-03-07_1453.test
ID 272 gen 23 top level 270 path fex/spool/.snapshot/2021-03-07_1531.test
ID 273 gen 25 top level 270 path fex/spool/.snapshot/2021-03-07_1532.test
ID 274 gen 27 top level 270 path fex/spool/.snapshot/2021-03-07_1718.test

Accessing btrfs directly without nfs has no problems:

root@tsmsrvj:~# find /data/fex | wc -l
489887

root@tsmsrvj:~# lsb_release -rd
Description: Ubuntu 20.04.2 LTS
Release: 20.04

root@tsmsrvj:# uname -a
Linux tsmsrvj 5.4.0-66-generic #74-Ubuntu SMP Wed Jan 27 22:54:38 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

root@tsmsrvj:# btrfs version
btrfs-progs v5.4.1

root@tsmsrvj:# dpkg -l | grep nfs-
ii nfs-common 1:1.3.4-2.5ubuntu3.3 amd64 NFS support files common to client and server
ii nfs-kernel-server 1:1.3.4-2.5ubuntu3.3 amd64 support for NFS kernel server

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. It seems that your bug report is not filed about a specific source package though, rather it is just filed against Ubuntu in general. It is important that bug reports be filed about source packages so that people interested in the package can find the bugs about it. You can find some hints about determining what package your bug might be about at https://wiki.ubuntu.com/Bugs/FindRightPackage. You might also ask for help in the #ubuntu-bugs irc channel on Freenode.

To change the source package that this bug is filed about visit https://bugs.launchpad.net/ubuntu/+bug/1918599/+editstatus and add the package name in the text box next to the word Package.

[This is an automated message. I apologize if it reached you inappropriately; please just reply to this message indicating so.]

tags: added: bot-comment
Revision history for this message
Ulli Horlacher (framstag) wrote : Re: [Bug 1918599] Re: "File system loop detected" with btrfs over NFS

On Thu 2021-03-11 (12:31), Ubuntu Foundations Team Bug Bot wrote:

> Thank you for taking the time to report this bug and helping to make
> Ubuntu better. It seems that your bug report is not filed about a
> specific source package though, rather it is just filed against Ubuntu
> in general. It is important that bug reports be filed about source
> packages so that people interested in the package can find the bugs
> about it.

I am not sure whether the bug is in btrfs, nfs-server or the GNU utilities
or in a combination of them.

--
Ullrich Horlacher Server und Virtualisierung
Rechenzentrum TIK
Universitaet Stuttgart E-Mail: <email address hidden>
Allmandring 30a Tel: ++49-711-68565868
70569 Stuttgart (Germany) WWW: http://www.tik.uni-stuttgart.de/
REF:<email address hidden>

affects: ubuntu → nfs-utils (Ubuntu)
tags: added: focal
Revision history for this message
Ulli Horlacher (framstag) wrote :

I have reported the bug also on the btrfs mailing list.
They say, it is a bug of the nfs server, which get confused about btrfs snapshots.

As a consequence I cannot use (any more) btrfs on the Ubuntu 20.04 nfs server (Ubuntu 18.04 is ok):

root@tsmsrvj:~# mount | grep data
/dev/sdb1 on /data type btrfs (rw,relatime,space_cache,user_subvol_rm_allowed,subvolid=5,subvol=/)
localhost:/data/fex on /nfs/localhost/fex type nfs4 (rw,relatime,vers=4.2,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=127.0.0.1,local_lock=none,addr=127.0.0.1)

root@tsmsrvj:~# ls -R /nfs/localhost/fex | wc
ls: /nfs/localhost/fex/spool: not listing already-listed directory

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.