Bug 209399 - Can't unmount bind-mounted NFS mounts with "Stale file handle"
Summary: Can't unmount bind-mounted NFS mounts with "Stale file handle"
Status: NEW
Alias: None
Product: File System
Classification: Unclassified
Component: NFS (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Trond Myklebust
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-09-26 08:03 UTC by Vadim Rutkovsky
Modified: 2020-09-26 08:05 UTC (History)
0 users

See Also:
Kernel Version: 5.7
Subsystem:
Regression: Yes
Bisected commit-id:


Attachments

Description Vadim Rutkovsky 2020-09-26 08:03:28 UTC
Steps to reproduce (basically, get "Stale file handle" error on bind-mounted nfs dir):

1. Use this dummy /etc/exports:
/var/tmp 127.0.0.1(rw,sync,all_squash,anonuid=1000)

2. Mount it to /mnt/test:
$ mkdir /mnt/test
$ mount localhost:/var/tmp /mnt/test

3. Bind-mount a subdirectory of it to /mnt/test2:
$ mkdir /mnt/test/reproduce
$ mkdir /mnt/test2
$ mount --bind /mnt/test/reproduce /mnt/test2

4. Remove the bind-mounted dir
$ rmdir /mnt/test/reproduce

5. Check that /mnt/test2 is not happy about that
$ ls /mnt/test2
ls: cannot access '/mnt/test2': Stale file handle

This is expected.

6. Try to unmount /mnt/test2
$ umount /mnt/test2
umount.nfs4: /mnt/test2: Stale file handle

This is not expected! There is no way how to unmount the directory. It's mounted forever. Even reboot gets stuck.

Reported in Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=1854379
This seems to work as expected in 5.6.x kernels, started happening in 5.7 and affects 5.8 too

Note You need to log in before you can comment on or make changes to this bug.